Forge Home

hiera_yaml_hierarchy_expander

Hiera backend plugin that expands the hierarchy definition by interpolating arrays and wildcards

6,624 downloads

5,465 latest version

4.3 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

  • 2.0.1 (latest)
  • 2.0.0
  • 1.0.2
  • 1.0.1
  • 1.0.0
released Dec 19th 2017
This version is compatible with:
  • Puppet Enterprise 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.0.0 < 5.0.0
  • , , ,
This module has been deprecated by its author since May 15th 2020.

Start using this module

Tags: hiera, backend, yaml

Documentation

sbitio/hiera_yaml_hierarchy_expander — version 2.0.1 Dec 19th 2017

hiera-yaml_hierarchy_expander

Hiera backend plugin that expands the hierarchy definition by interpolating arrays and wildcards.

This module is deprecated in Puppet > 4.9 / Hiera 5

Happily, Hiera 5 provides (almost) the same functionality as this extension, so our recomendation is to upgrade and stop using yaml_hierarchy_expander.

See Hiera: Config file syntax for details.

In a brief, here's the correspondence between yaml_hierarchy_expander config and the Hiera 5 equivalent.

# yaml_hierarchy_expander

:hierarchy:
  - 'groups/%{::groups}'
  - 'common/*'

# hiera 5

hierarchy:
  - name: Per group data files
    mapped_paths: [facts.groups, group, "groups/%{group}.yaml"]

  - name: Common data data glob
    glob: "common/*.yaml"

The only feature not covered by Hiera 5 is a mix of array expansion and wildcards like:

groups/%{::groups}/*

This is a kind of mapped_globs, not provided (yet?) by Hiera 5.

Compatibility

Use 1.x.x releases for Hiera 1.x and 2.x, and 2.x.x releases for Hiera 3.x.

Example

:backends:
  - yaml_hierarchy_expander

:logger: console

:hierarchy:
  - 'nodes/%{::fqdn}'
  - 'groups/%{::groups}'
  - 'common/*'

:yaml_hierarchy_expander:
  :datadir: '/etc/puppet/environments/%{::environment}/hieradata'
  :expanders: ['::groups']

This example shows the two features of the backend:

  • common/* is expanded to as much hierarchy lines as yaml files found in the common/ subdirectory
  • ::groups is an array, and since it is declared in the :expanders: section, it is expanded to a hierarchy line per item in the array

License

MIT License, see LICENSE file.

Contact

Use contact form at http://sbit.io

Support

Please log tickets and issues on GitHub