Multi-purpose puppet module

I’ve been using Foreman for a little while now and applying host configuration with puppet. While puppet can be powerful, I found that maintaining a collection of modules to manage otherwise simple configurations was a pain. I wrote a single module that allows configuration of many puppet types using hiera. Once you start with this you’ll quickly rid yourself of single-purpose modules and start defining systems entirely in hiera.

First, get the module:

Next, configure hiera on the foreman by modifying ‘/etc/puppetlabs/puppet/hiera.conf’. Here’s an example I’m using:

version: 5
datadir: /etc/puppetlabs/hieradata
data_hash: yaml_data


  • name: “Order: nodes, platform, OS version, OS family”
    • “nodes/%{::trusted.certname}”
    • “platform/%{::virtual}.yaml”
    • “hostgroup/%{hostgroup}.yaml”
    • “os/%{}-%{::os.release.major}.yaml”
    • “os/%{}.yaml”

Last, define resources in hiera. The module merges values by default, making it easy to layer resource definitions and target resources by various facts. I’ve found this much easier to work with than traditional puppet modules.

Isn’t this pretty much the same as