Hello all,
I’m curious if anyone is doing some fancy stuff like asserting Puppet Facts (such as Role, Org, Location) at provision time.
I find myself asking about how to tackle the chicken/egg problem of wanting to use Hiera data based on Roles (in a role/profile pattern). The only way Hiera can see a system’s role is if there’s a role fact established. The only way to establish a role fact is to have puppet run once, which deploys the fact and populates it, then have puppet run again and process based on the presence of that fact.
Some ppl in the Puppet Slack Channel have suggested using the pp_role OID as a trusted fact. But this does not solve the chicken+egg initiation problem.
My thought is that using a provisioning template which uses ERB to add Foreman Param Data to some custom fact yaml files into /etc/puppetlabs/facter/facts.d. A hostgroup could have a role class inclusion and a param set to define the role, new hosts provisioned inside that group would have that role param value inserted into a /etc/puppetlabs/facter/facts.d/role.yaml file.
I know there are some Foreman folks using role/profile patterns. What do you think about this or how do you handle the initiation issue?
Thanks!