Ask Your Question

Is there a learning puppet style tutorial that includes hiera?

asked 2013-05-22 12:38:18 -0600

jerrac gravatar image

updated 2013-05-22 13:36:19 -0600

The Learning Puppet Series is pretty good. I learned a lot from it. But now that Hiera is part of Puppet 3, it's missing a big important part of Puppet.

The Hiera Docs are also good, but there's something missing that keeps me from getting Hiera. I think what's missing is a more detailed demonstration of how to plan your puppet set up with Hiera. The complete example just gives an example, it doesn't really cover how to think it through.

Hmm... Maybe what I'm actually after is a version of the few chapters of ... (more)

edit retag flag offensive close merge delete


So, you're looking for more architectural and design information on how you should design your hierarchy, and what types of things in your puppet code that you should drive ...(more)

Ancillas gravatar imageAncillas ( 2013-05-22 13:31:00 -0600 )edit

That sounds about right.

jerrac gravatar imagejerrac ( 2013-05-22 13:37:14 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-05-24 12:27:25 -0600

Ancillas gravatar image

updated 2013-05-29 12:54:47 -0600

Many people use hiera differently, and the architectural piece really depends on your specific domain. I personally start specific to generic: host, cluster, datacenter, common.

Most of the application configurations go into the cluster yaml files. So, say I have a web application cluster called web-app-cluster. I'd then have web-app-cluster.yaml which might have database connection information, log directories, etc... If I needed to override a server's behavior, say to enable verbose logging, or disable a specific feature, I would put that config into a yaml file that matches the host. e.g. if the hostname is webserver1 ... (more)

edit flag offensive delete link more


What if I fully define a class in common, but override one parameter in the hostname file? Doe Hiera combine them? Or do I have repeat all the defaults in ...(more)

jerrac gravatar imagejerrac ( 2013-05-28 15:43:51 -0600 )edit

I tacked on another example to my answer. Let me know if you need further clarification.

Ancillas gravatar imageAncillas ( 2013-05-28 23:41:06 -0600 )edit

So, if I have ```webserver::port``` and ```webserver::dbname``` configured in common, and I only have ```webserver::dbname``` configured in server-1, heira() will get ```webserver::port``` from common, and ```webserver ...(more)

jerrac gravatar imagejerrac ( 2013-05-29 14:36:20 -0600 )edit

Exactly. hiera() marches through your hierarchy in hiera.yaml, and returns the first matching result. hiera\_array() and hiera_hash() march through your hierarchy, find all matches, and combine them together ...(more)

Ancillas gravatar imageAncillas ( 2013-05-29 18:33:31 -0600 )edit

You can play with hiera on the command line to test your hiera configs. Setup the config files above and try `hiera webserver::url hostname=server-1`. You can override any ...(more)

Ancillas gravatar imageAncillas ( 2013-05-29 18:37:58 -0600 )edit

Your Answer

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

Add Answer

Question Tools



Asked: 2013-05-22 12:38:18 -0600

Seen: 564 times

Last updated: May 29 '13