Forge Home

hiera_resources

Allow arbitrary definition of resources (classes and defined types) via hiera content while avoiding the hiera_hash/create_resources pattern.

69,368 downloads

7,811 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 999.999.999 (latest)
  • 1.0.1
  • 1.0.0
  • 0.9.2
  • 0.9.1
  • 0.9.0
released May 23rd 2015
This version is compatible with:
This module has been deprecated by its author since May 15th 2020.

Start using this module

Documentation

rnelson0/hiera_resources — version 0.9.2 May 23rd 2015

hiera_resources

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Beginning with hiera_resources
  4. Usage - Configuration options and additional functionality
  5. Credit

Overview

Allow arbitrary definition of resources (classes and defined types) via hiera content while avoiding the hiera_hash/create_resources pattern.

Module Description

If applicable, this section should have a brief description of the technology the module integrates with and what that integration enables. This section should answer the questions: "What does this module do?" and "Why would I use it?"

If your module has a range of functionality (installation, configuration, management, etc.) this is the time to mention it.

Beginning with hiera_resources

hiera_resources() allows you to use arbitrary hiera data to create and manage classes and defined types. Provide a hash with a top level name followed by a second level resource type and subsequent levels containing the required resource parameters and values.

For instance, given the following hiera YAML file:

---
messages1:
  notify:
    title 1:
      message: this is the first message stored in YAML
    title 2:
      message: this is the second message stored in YAML

You may include hiera_resources('messages1') in a manifest to create two notify resources, 'title 1' and 'title 2'.

hiera_resources() does not verify the contents of the hash or referenced resource type. It does accept a second value as a default value if the lookup fails, following the same tiered hierarchy as the hiera hash.

Usage

Ensure that hiera_resources is in your $modulepath and that pluginsync is set to true on the master. You may then use hiera_resources() in your manifests.

Credits

This version of hiera_resources is based on this excellent blog post by Robin Bowes and a subsequent refactoring.