Configure settings with Hiera
Hiera is hierarchy-based configuration management that relies on a defaults with overrides system. When you add a parameter or setting to your Hiera data, Hiera searches through the data, in the order defined, to find the value you want to change. Once found, it overrides the default value with the new parameter or setting. You can use Hiera to manage your Puppet Enterprise (PE) configuration settings.
Separating data (Hiera) in the Puppet documentation explains more about how to use Hiera and what you can configure in Hiera.
Changes to PE configuration settings in Hiera
override configuration settings in pe.conf
, but not those set in the PE console. However, settings declared in the console override
Hiera data. It's best to use Hiera when you want to:
- Change parameters in non-profile classes.
- Set parameters that are static and version-controlled.
- Configure for high availability.
To configure a setting in Hiera:
- Open a Hiera data file in a text editor.
The default location for *nix systems is:
/etc/puppetlabs/code/environments/<ENVIRONMENT>/data/common.yaml
On Windows systems, it is:
%CommonAppData%\PuppetLabs\code\environments\<ENVIRONMENT>\data\common.yaml
Thedatadir
setting in thehiera.yaml
configuration file changes the Hiera data file location. You can also change the common data file path in thehierarchy
section of thehiera.yaml
file. If you changed either of these settings, you'll find the default Hiera data files in your customized location. - Add your new parameter to the Hiera data file.
For example, the following declaration increases sets number of seconds before a node is considered unresponsive to 4000, whereas the defeault setting is 3600 seconds:
puppet_enterprise::console_services::no_longer_reporting_cutoff: 4000
- Save the file and run
puppet agent -t
to compile the changes.