:hierarchy: - defaults - %{clientcert} - %{environment} - globalIn the new way the hierarchy has been renamed categories, and each level of it is a category.
We can define category precedence in the system wide hiera.yaml, the module specific hiera.yaml, and the binder_config.yaml
The following binder_config.yaml will effectively insert the species category into the category listing:
--- version: 1 layers: [{name: site, include: 'confdir-hiera:/'}, {name: modules, include: ['module-hiera:/*/', 'module:/*::default'] } ] categories: [['node', '${fqdn}'], ['environment', '${environment}'], ['species', '${species}'], ['osfamily', '${osfamily}'], ['common', 'true'] ]This means we can use the species category if one is defined in a module. An example hiera.yaml from such a module is:
--- version: 2 hierarchy: [['osfamily', '$osfamily', 'data/osfamily/$osfamily'], ['species', '$species', 'data/species/$species'], ['environment', '$environment', 'data/env/$environment'], ['common', 'true', 'data/common'] ]Which means when we run Puppet...
root@hiera-2:/etc/puppet# FACTER_species='human' puppet apply modules/startrek/tests/init.pp Notice: Compiled catalog for hiera-2.green.gah in environment production in 1.07 seconds Notice: janeway commands the voyager Notice: /Stage[main]/Startrek/Notify[janeway commands the voyager]/message: defined 'message' as 'janeway commands the voyager' Notice: janeway is always wary of the section 31 Notice: /Stage[main]/Startrek/Notify[janeway is always wary of the section 31]/message: defined 'message' as 'janeway is always wary of the section 31' Notice: Finished catalog run in 0.11 secondsYou can see full example code in the startrek module.
You can pre-order my book, Pro Puppet 2nd Ed, here.
Nice article
ReplyDelete303 Read About Area Code which State Locations, cities, Timezone.