Adding Hiera data to your Puppet repo
Your Vagrant VM is already set up with a suitable Hiera config and the sample data file, in the /etc/puppetlabs/code/environments/pbg
directory. Try it now:
Run the following commands:
sudo puppet lookup --environment pbg test
--- This is a test
Note
We haven't seen the --environment
switch before, so it's time to briefly introduce Puppet environments. A Puppet environment is a directory containing a Hiera config file, Hiera data, a set of Puppet manifests—in other words, a complete, self-contained Puppet setup. Each environment lives in a named directory under /etc/puppetlabs/code/environments
. The default environment is production
, but you can use any environment you like by giving the --environment
switch to the puppet lookup
command. In the example, we are telling Puppet to use the /etc/puppetlabs/code/environments/pbg
directory.
When you come to add Hiera data to your own Puppet environment, you can use the example hiera.yaml
and data files as a starting...