hi,

> The usual role/profile pattern for Puppet says one node => one role.

you are definitely right. I started with mysql …. to get the hiera basics 
running … but, at this time, I just learning, how other do it and what fits for 
us :-)

> What would interesting me though, would be to know how you assign this
> role hierarchy to your nodes? Can you show your hiera.yaml file?

yepp: https://groups.google.com/forum/#!topic/puppet-users/9G6z_kK3O9A

there is my thread on the puppet-user:

(just a plain copy from other howtos and tests … I expect only 3 or 4 lines in 
the final version)

:hierarchy:
  - "node/%{::fqdn}"
  - "role/%{::role}"
  - "profile/%{::profile}"
  - "operatingsystem/%{::operatingsystem}/%{::operatingsystemmajrelease}"
  - "operatingsystem/%{::operatingsystem}"
  - "osfamily/%{::osfamily}"
  - "datacenter/%{::datacenter}"
  - "virtual/%{::is_virtual}"
  - common

I added a custom fact via a module to have „facter -p role“, that gives me the 
extracted hostname (mon-01 / mon01 -> mon)

copied from here: 
https://rnelson0.com/2014/07/14/intro-to-roles-and-profiles-with-puppet-and-hiera/

the reason was: no hardcoded roles in the fact and I’m a fan of „speaking“ 
hostnames, so this solution is at this time perfect.

> The rule of thumb for automatic lookup of variables is:
> 
> $var in class icinga2::features::api => icinga2::features::api::var in
> your hiera file.

ahh, that is it :-)

> You can take a look at this PR which introduces a working set-up using
> hiera for configuration for most aspects:
> https://github.com/Icinga/puppet-icinga2-rewrite/pull/32

That is awesome ! That kind of example is perfect, exactly what I need to the 
idea :-)

Thank you so much !

cu denny

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to