hiera
: This class handles installing the hiera.yaml for Puppet's use. Creates either /etc/puppet/hiera.yaml or /etc/puppetlabs/puppet/hiera.yaml in set hiera version and links /etc/hiera.yaml to it. Creates $datadir (if $datadir_manage == true).hiera::deep_merge
: This class installs and configures deep_mergehiera::eyaml_gpg
: This calls install and configures hiera-eyaml-gpghiera::params
: This class handles OS-specific configuration of the hiera module. It looks for variables in top scope (probably from an ENC such as Dashboard). If the variable doesn't exist in top scope, it falls back to a hard coded default value.
hiera::eyaml
: This class installs and configures hiera-eyaml
hiera::install
: Private define
Hiera::Hiera5_defaults
: This will validate hiera 5 'defaults' hashHiera::Hiera5_hierarchy
: This will validate hiera 5 hierarchy array hash
=== Copyright:
Copyright (C) 2012 Hunter Haugen, unless otherwise noted. Copyright (C) 2013 Mike Arnold, unless otherwise noted. Copyright (C) 2014 Terri Haber, unless otherwise noted. Copyright (C) 2016 Vox Pupuli, unless otherwise noted.
The following parameters are available in the hiera
class:
hierarchy
hiera_version
hiera5_defaults
backends
backend_options
hiera_yaml
create_symlink
datadir
datadir_manage
owner
group
mode
eyaml_owner
eyaml_group
provider
eyaml
eyaml_name
eyaml_version
eyaml_source
eyaml_datadir
eyaml_extension
confdir
puppet_conf_manage
logger
cmdpath
create_keys
keysdir
deep_merge_name
deep_merge_version
deep_merge_source
deep_merge_options
merge_behavior
extra_config
master_service
manage_package
manage_eyaml_package
manage_deep_merge_package
manage_eyaml_gpg_package
package_name
package_ensure
eyaml_gpg_name
eyaml_gpg_version
eyaml_gpg_source
eyaml_gpg
eyaml_gpg_gnupghome_recurse
eyaml_gpg_recipients
eyaml_pkcs7_private_key
eyaml_pkcs7_public_key
ruby_gpg_name
ruby_gpg_version
ruby_gpg_source
gem_install_options
gem_source
Data type: Variant[Array, Array[Hash]]
The hiera hierarchy.
Default value: $hiera::params::hierarchy
Data type: Optional[Enum['3','5']]
To set hiera 5 defaults. e.g. datadir, data_hash.
Default value: $hiera::params::hiera_version
Data type: Hiera::Hiera5_defaults
Version format to layout hiera.yaml. Should be a string.
Default value: $hiera::params::hiera5_defaults
Data type: Any
The list of backends. If you supply a additional backend you must also supply the backend data in the backend_options hash.
Default value: ['yaml']
Data type: Any
An optional hash of backend data for any backend. Each key in the hash should be the name of the backend as listed in the backends array. You can also supply additional settings for the backend by passing in a hash. By default the yaml and eyaml backend data will be added if you enable them via their respective parameters. Any options you supply for yaml and eyaml backend types will always override other parameters supplied to the hiera class for that backend.
Example hiera data for the backend_options hash:
backend_options:
json:
datadir: '/etc/puppetlabs/puppet/%{environment}/jsondata'
redis:
password: clearp@ssw0rd # if your Redis server requires authentication
port: 6380 # unless present, defaults to 6379
db: 1 # unless present, defaults to 0
host: db.example.com # unless present, defaults to localhost
path: /tmp/redis.sock # overrides port if unixsocket exists
soft_connection_failure: true # bypass exception if Redis server is unavailable; default is false
separator: / # unless present, defaults to :
deserialize: :json # Try to deserialize; both :yaml and :json are supported
NOTE: The backend_options must not contain symbols as keys ie :json: despite the hiera config needing symbols. The template will perform all the conversions to symbols in order for hiera to be happy. Because puppet does not use symbols there are minor annoyances when converting back and forth and merge data together.
Default value: {}
Data type: Any
The path to the hiera config file. Note: Due to a bug, hiera.yaml is not placed in the codedir. Your puppet.conf hiera_config setting must match the configured value; see also hiera::puppet_conf_manage
Default value: $hiera::params::hiera_yaml
Data type: Any
Whether to create the symlink /etc/hiera.yaml
Default value: true
Data type: Any
The path to the directory where hiera will look for databases.
Default value: $hiera::params::datadir
Data type: Any
Whether to create and manage the datadir as a file resource.
Default value: true
Data type: Any
The owner of managed files and directories.
Default value: $hiera::params::owner
Data type: Any
The group owner of managed files and directories.
Default value: $hiera::params::group
Data type: Any
Default value: $hiera::params::mode
Data type: Any
Default value: $hiera::params::eyaml_owner
Data type: Any
Default value: $hiera::params::eyaml_group
Data type: Any
Which provider to use to install hiera-eyaml. Can be: puppetserver_gem (PE 2015.x or FOSS using puppetserver) pe_puppetserver_gem (PE 3.7 or 3.8) pe_gem (PE pre-3.7) puppet_gem (agent-only gem) gem (FOSS using system ruby (ie puppetmaster)) Note: this module cannot detect FOSS puppetserver and you must pass provider => 'puppetserver_gem' for that to work. See also master_service.
Default value: $hiera::params::provider
Data type: Any
Whether to install, configure, and enable the eyaml backend. Also see the provider and master_service parameters.
Default value: false
Data type: Any
The name of the eyaml gem.
Default value: 'hiera-eyaml'
Data type: Any
The version of hiera-eyaml to install. Accepts 'installed', 'latest', '2.0.7', etc
Default value: undef
Data type: Any
An alternate gem source for installing hiera-eyaml.
Default value: undef
Data type: Any
The path to the directory where hiera will look for databases with the eyaml backend.
Default value: undef
Data type: Any
The file extension for the eyaml backend.
Default value: undef
Data type: Any
The path to Puppet's confdir.
Default value: $hiera::params::confdir
Data type: Any
Whether to manage the puppet.conf hiera_config value or not.
Default value: true
Data type: Any
Which hiera logger to use. Note: You need to manage any package/gem dependencies yourself.
Default value: 'console'
Data type: Any
Search paths for command binaries, like the eyaml command. The default should cover most cases.
Default value: $hiera::params::cmdpath
Data type: Any
Whether to create pkcs7 keys and manage key files for hiera-eyaml. This is useful if you need to distribute a pkcs7 key pair.
Default value: true
Data type: Any
Directory for hiera to manage for eyaml keys. Note: If using PE 2013.x+ and code-manager set the keysdir under the $confdir/code-staging directory to allow the code manager to sync the keys to all PuppetServers Example: /etc/puppetlabs/code-staging/keys
Default value: undef
Data type: Any
The name of the deep_merge gem.
Default value: 'deep_merge'
Data type: Any
The version of deep_merge to install. Accepts 'installed', 'latest', '2.0.7', etc.
Default value: undef
Data type: Any
An alternate gem source for installing deep_merge.
Default value: undef
Data type: Any
A hash of options to set in hiera.yaml for the deep merge behavior.
Default value: {}
Data type: Any
Which hiera merge behavior to use. Valid values are 'native', 'deep', and 'deeper'. Deep and deeper values will install the deep_merge gem into the puppet runtime.
Default value: undef
Data type: Any
Arbitrary YAML content to append to the end of the hiera.yaml config file. This is useful for configuring backend-specific parameters.
Default value: ''
Data type: Any
The service name of the master to restart after package installation or hiera.yaml changes. Note: You must pass master_service => 'puppetserver' for FOSS puppetserver
Default value: $hiera::params::master_service
Data type: Any
A boolean for wether the hiera package should be managed.
Default value: $hiera::params::manage_package
Data type: Boolean
Default value: true
Data type: Boolean
Default value: true
Data type: Boolean
Default value: true
Data type: Any
Specifies the name of the hiera package.
Default value: $hiera::params::package_name
Data type: Any
Specifies the ensure value of the hiera package.
Default value: $hiera::params::package_ensure
Data type: Any
Default value: 'hiera-eyaml-gpg'
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Any
Default value: false
Data type: Boolean
Whether to recurse and set permissions in the gpgdir. This is imporant to protect the key, but makes puppet agent raise an error on each run. You can set the mode on these files to 0600 by yourself and set this to false.
Default value: true
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Any
Default value: 'ruby_gpg'
Data type: Any
Default value: undef
Data type: Any
Default value: undef
Data type: Optional[Array]
An array of install options to pass to the gem package resources. Typically, this parameter is used to specify a proxy server. eg gem_install_options => ['--http-proxy', 'http://proxy.example.com:3128']
Default value: undef
Data type: Any
Default value: undef
=== Copyright:
Copyright (C) 2016 Joseph Yaworski, unless otherwise noted.
This calls install and configures hiera-eyaml-gpg
=== Copyright:
Copyright (C) 2013 Mike Arnold, unless otherwise noted.
This will validate hiera 5 'defaults' hash
Alias of
Struct[{
datadir => Optional[String],
data_hash => Optional[Enum['yaml_data', 'json_data', 'hocon_data']],
lookup_key => Optional[String],
data_dig => Optional[String],
hiera3_backend => Optional[String],
options => Optional[Hash],
}]
This will validate hiera 5 hierarchy array hash
Alias of
Array[Struct[{
name => String,
path => Optional[String],
paths => Optional[Array[String]],
glob => Optional[String],
globs => Optional[Array[String]],
uri => Optional[String],
uris => Optional[Array[String]],
data_hash => Optional[String],
lookup_key => Optional[String],
data_dig => Optional[String],
datadir => Optional[String],
hiera3_backend => Optional[String],
options => Optional[Hash],
}]]