Skip to content

Instantly share code, notes, and snippets.

@zipkid
Created June 24, 2014 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zipkid/b9f023587cb6b8ae909d to your computer and use it in GitHub Desktop.
Save zipkid/b9f023587cb6b8ae909d to your computer and use it in GitHub Desktop.
19:58 < happytux> I do this because I want that the role 'role::mail::primary' will be looked up as mail_primary.yaml.
see files...
as fact or in site.pp or via an ENC or whatever method set $role and $subrol for a node
in the following hierarchy
/etc/puppet/hieradata/mail/primary.yaml
/etc/puppet/hieradata/mail/secondary.yaml
/etc/puppet/hieradata/mail/common.yaml
/etc/puppet/hieradata/<otherrole>/common.yaml
---
:hierarchy:
- 01_nodes/%{::fqdn}
- 01_nodes/%{::hostname}
- 02_roles/%{::role}/${::subrole}
- 02_roles/%{::role}/common
- common
:yaml:
:datadir: /etc/puppet/hieradata
---
classes:
- <class common to all mail subroles>
---
classes:
- postfix
- <someclass>
# This will combine the array of all the classes in the matching yaml files in the hierarchy.
hiera_include("classes", [] )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment