Ask Your Question
0

hiera.yaml with structured facts

asked 2015-12-01 17:44:34 -0500

lclegg gravatar image

updated 2015-12-01 18:04:36 -0500

I'm running the latest/greatest Open Puppet on both my Puppetserver and clients all on Oracle Linux V6.7.

I use structured facts from /opt/puppetlabs/facter/facts.d/myfacts.txt. For example: my_role=DATABASE

Then in my /etc/puppetlabs/code/hiera.yaml file I have this line in the hierarchy:

-"roles/%{::my_role}"

This all works just fine. When a server is identified as a DATABASE server then the DATABASE.yaml file is used appropriately.

What I want to do is to be able to use a fact like this:

my_role=DATABASE,WEB

and have hiera run thru both the DATABASE.yaml and WEB.yaml files.

I'm not being successful at all. I'm not sure if this is possible or if I just haven't figured out the right way to set things up. Any guidance is very much appreciated. Thank you,

Larry

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-12-02 03:47:15 -0500

strictly speaking a host should generally have just one role. functionality of that role is that its made uip of one or more profiles.

web, database etc would be the profile

so role for this box would include web/database + anyother

have a read of: good intro to roles and profiles

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-12-01 17:44:34 -0500

Seen: 196 times

Last updated: Dec 02 '15