-
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
66 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
### Classes | ||
|
||
* [`hiera`](#hiera): == Class: hiera This class handles installing the hiera.yaml for Puppet's use. === Parameters: See README. === Actions: Installs eithe | ||
* [`hiera`](#hiera): This class handles installing the hiera.yaml for Puppet's use. | ||
* [`hiera::deep_merge`](#hiera--deep_merge): == Class: hiera::deep_merge This class installs and configures deep_merge === Authors: Joseph Yaworski <[email protected]> === Copyrig | ||
* [`hiera::eyaml`](#hiera--eyaml): == Class: hiera::eyaml This class installs and configures hiera-eyaml === Authors: Terri Haber <[email protected]> === Copyright: Cop | ||
* [`hiera::eyaml_gpg`](#hiera--eyaml_gpg): == Class hiera::eyaml_gpg This calls install and configures hiera-eyaml-gpg | ||
|
@@ -25,14 +25,22 @@ | |
|
||
### <a name="hiera"></a>`hiera` | ||
|
||
== Class: hiera | ||
|
||
This class handles installing the hiera.yaml for Puppet's use. | ||
|
||
=== Parameters: | ||
|
||
See README. | ||
|
||
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. | ||
=== Actions: | ||
|
||
Installs either /etc/puppet/hiera.yaml or /etc/puppetlabs/puppet/hiera.yaml. | ||
|
@@ -143,87 +151,99 @@ The following parameters are available in the `hiera` class: | |
|
||
Data type: `Variant[Array, Array[Hash]]` | ||
|
||
|
||
The hiera hierarchy. Default: [] For Hiera verison 5. Default: [{}] | ||
|
||
Default value: `$hiera::params::hierarchy` | ||
|
||
##### <a name="-hiera--hiera_version"></a>`hiera_version` | ||
|
||
Data type: `Optional[Enum['3','5']]` | ||
|
||
|
||
To set hiera 5 defaults. e.g. datadir, data_hash. Default: {'datadir' => 'data', 'data_hash' => 'yaml_data'} | ||
|
||
Default value: `$hiera::params::hiera_version` | ||
|
||
##### <a name="-hiera--hiera5_defaults"></a>`hiera5_defaults` | ||
|
||
Data type: `Hiera::Hiera5_defaults` | ||
|
||
|
||
Version format to layout hiera.yaml. Should be a string. Default: 3 | ||
|
||
Default value: `$hiera::params::hiera5_defaults` | ||
|
||
##### <a name="-hiera--backends"></a>`backends` | ||
|
||
Data type: `Any` | ||
|
||
|
||
The list of backends. Default: ['yaml'] If you supply a additional backend you must also supply the backend data in the backend_options hash. | ||
|
||
Default value: `['yaml']` | ||
|
||
##### <a name="-hiera--backend_options"></a>`backend_options` | ||
|
||
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. | ||
|
||
Default value: `{}` | ||
|
||
##### <a name="-hiera--hiera_yaml"></a>`hiera_yaml` | ||
|
||
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: | ||
|
||
'/etc/puppet/hiera.yaml' for Puppet Open Source | ||
'/etc/puppetlabs/puppet/hiera.yaml' for Puppet Enterprise | ||
|
||
Default value: `$hiera::params::hiera_yaml` | ||
|
||
##### <a name="-hiera--create_symlink"></a>`create_symlink` | ||
|
||
Data type: `Any` | ||
|
||
|
||
Whether to create the symlink /etc/hiera.yaml Default: true | ||
|
||
Default value: `true` | ||
|
||
##### <a name="-hiera--datadir"></a>`datadir` | ||
|
||
Data type: `Any` | ||
|
||
The path to the directory where hiera will look for databases. Default: | ||
|
||
'/etc/puppetlabs/puppet/hieradata' for PE Puppet < 4 | ||
'/etc/puppetlabs/code/environments/%{environment}/hieradata' for Puppet >= 4 | ||
|
||
Default value: `$hiera::params::datadir` | ||
|
||
##### <a name="-hiera--datadir_manage"></a>`datadir_manage` | ||
|
||
Data type: `Any` | ||
|
||
|
||
Whether to create and manage the datadir as a file resource. Default: true | ||
|
||
Default value: `true` | ||
|
||
##### <a name="-hiera--owner"></a>`owner` | ||
|
||
Data type: `Any` | ||
|
||
The owner of managed files and directories. Default: | ||
|
||
'puppet' for Puppet Open Source | ||
'pe-puppet' for Puppet Enterprise | ||
|
||
Default value: `$hiera::params::owner` | ||
|
||
##### <a name="-hiera--group"></a>`group` | ||
|
||
Data type: `Any` | ||
|
||
The group owner of managed files and directories. Default: | ||
|
||
'puppet' for Puppet Open Source | ||
'pe-puppet' for Puppet Enterprise | ||
|
||
Default value: `$hiera::params::group` | ||
|
||
|
@@ -255,167 +275,173 @@ 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: Depends on puppet version detected as specified above. | ||
|
||
Default value: `$hiera::params::provider` | ||
|
||
##### <a name="-hiera--eyaml"></a>`eyaml` | ||
|
||
Data type: `Any` | ||
|
||
|
||
Whether to install, configure, and enable the eyaml backend. Also see the provider and master_service parameters. Default: false | ||
|
||
Default value: `false` | ||
|
||
##### <a name="-hiera--eyaml_name"></a>`eyaml_name` | ||
|
||
Data type: `Any` | ||
|
||
|
||
The name of the eyaml gem. Default: 'hiera-eyaml' | ||
|
||
Default value: `'hiera-eyaml'` | ||
|
||
##### <a name="-hiera--eyaml_version"></a>`eyaml_version` | ||
|
||
Data type: `Any` | ||
|
||
|
||
The version of hiera-eyaml to install. Accepts 'installed', 'latest', '2.0.7', etc Default: undef | ||
|
||
Default value: `undef` | ||
|
||
##### <a name="-hiera--eyaml_source"></a>`eyaml_source` | ||
|
||
Data type: `Any` | ||
|
||
|
||
An alternate gem source for installing hiera-eyaml. Default: undef, uses gem backend default | ||
|
||
Default value: `undef` | ||
|
||
##### <a name="-hiera--eyaml_datadir"></a>`eyaml_datadir` | ||
|
||
Data type: `Any` | ||
|
||
|
||
The path to the directory where hiera will look for databases with the eyaml backend. Default: same as datadir | ||
|
||
Default value: `undef` | ||
|
||
##### <a name="-hiera--eyaml_extension"></a>`eyaml_extension` | ||
|
||
Data type: `Any` | ||
|
||
|
||
The file extension for the eyaml backend. Default: undef, backend defaults to '.eyaml' | ||
|
||
Default value: `undef` | ||
|
||
##### <a name="-hiera--confdir"></a>`confdir` | ||
|
||
Data type: `Any` | ||
|
||
|
||
The path to Puppet's confdir. Default: $settings::confdir which should be '/etc/puppetlabs/puppet' | ||
|
||
Default value: `$hiera::params::confdir` | ||
|
||
##### <a name="-hiera--puppet_conf_manage"></a>`puppet_conf_manage` | ||
|
||
Data type: `Any` | ||
|
||
|
||
Whether to manage the puppet.conf hiera_config value or not. Default: true | ||
|
||
Default value: `true` | ||
|
||
##### <a name="-hiera--logger"></a>`logger` | ||
|
||
Data type: `Any` | ||
|
||
|
||
Which hiera logger to use. Note: You need to manage any package/gem dependencies yourself. Default: undef, hiera defaults to 'console' | ||
|
||
Default value: `'console'` | ||
|
||
##### <a name="-hiera--cmdpath"></a>`cmdpath` | ||
|
||
Data type: `Any` | ||
|
||
|
||
Search paths for command binaries, like the eyaml command. The default should cover most cases. Default: ['/opt/puppet/bin', '/usr/bin', '/usr/local/bin'] | ||
|
||
Default value: `$hiera::params::cmdpath` | ||
|
||
##### <a name="-hiera--create_keys"></a>`create_keys` | ||
|
||
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: true | ||
|
||
Default value: `true` | ||
|
||
##### <a name="-hiera--keysdir"></a>`keysdir` | ||
|
||
Data type: `Any` | ||
|
||
|
||
Directory for hiera to manage for eyaml keys. Default: $confdir/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` | ||
|
||
##### <a name="-hiera--deep_merge_name"></a>`deep_merge_name` | ||
|
||
Data type: `Any` | ||
|
||
|
||
The name of the deep_merge gem. Default: 'deep_merge' | ||
|
||
Default value: `'deep_merge'` | ||
|
||
##### <a name="-hiera--deep_merge_version"></a>`deep_merge_version` | ||
|
||
Data type: `Any` | ||
|
||
|
||
The version of deep_merge to install. Accepts 'installed', 'latest', '2.0.7', etc. Default: undef | ||
|
||
Default value: `undef` | ||
|
||
##### <a name="-hiera--deep_merge_source"></a>`deep_merge_source` | ||
|
||
Data type: `Any` | ||
|
||
|
||
An alternate gem source for installing deep_merge. Default: undef, uses gem backend default | ||
|
||
Default value: `undef` | ||
|
||
##### <a name="-hiera--deep_merge_options"></a>`deep_merge_options` | ||
|
||
Data type: `Any` | ||
|
||
|
||
A hash of options to set in hiera.yaml for the deep merge behavior. Default: {} | ||
|
||
Default value: `{}` | ||
|
||
##### <a name="-hiera--merge_behavior"></a>`merge_behavior` | ||
|
||
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: undef, hiera defaults to 'native' | ||
|
||
Default value: `undef` | ||
|
||
##### <a name="-hiera--extra_config"></a>`extra_config` | ||
|
||
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: '' | ||
|
||
Default value: `''` | ||
|
||
##### <a name="-hiera--master_service"></a>`master_service` | ||
|
||
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: 'pe-puppetserver' for PE 2015.x, otherwise 'puppetmaster' | ||
|
||
Default value: `$hiera::params::master_service` | ||
|
||
##### <a name="-hiera--manage_package"></a>`manage_package` | ||
|
||
Data type: `Any` | ||
|
||
|
||
A boolean for wether the hiera package should be managed. Default: false | ||
|
||
Default value: `$hiera::params::manage_package` | ||
|
||
|
@@ -447,15 +473,15 @@ Default value: `true` | |
|
||
Data type: `Any` | ||
|
||
|
||
Specifies the name of the hiera package. Default: 'hiera' | ||
|
||
Default value: `$hiera::params::package_name` | ||
|
||
##### <a name="-hiera--package_ensure"></a>`package_ensure` | ||
|
||
Data type: `Any` | ||
|
||
|
||
Specifies the ensure value of the hiera package. Default: 'present' | ||
|
||
Default value: `$hiera::params::package_ensure` | ||
|
||
|
@@ -495,7 +521,7 @@ 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: true | ||
|
||
Default value: `true` | ||
|
||
|
@@ -551,7 +577,7 @@ 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` | ||
|
||
|