Skip to content

Latest commit

 

History

History
606 lines (337 loc) · 16.7 KB

REFERENCE.md

File metadata and controls

606 lines (337 loc) · 16.7 KB

Reference

Table of Contents

Classes

Public Classes

  • 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_merge
  • hiera::eyaml_gpg: This calls install and configures hiera-eyaml-gpg
  • hiera::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.

Private Classes

  • hiera::eyaml: This class installs and configures hiera-eyaml

Defined types

Private Defined types

  • hiera::install: Private define

Data types

Classes

hiera

=== 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.

Parameters

The following parameters are available in the hiera class:

hierarchy

Data type: Variant[Array, Array[Hash]]

The hiera hierarchy.

Default value: $hiera::params::hierarchy

hiera_version

Data type: Optional[Enum['3','5']]

To set hiera 5 defaults. e.g. datadir, data_hash.

Default value: $hiera::params::hiera_version

hiera5_defaults

Data type: Hiera::Hiera5_defaults

Version format to layout hiera.yaml. Should be a string.

Default value: $hiera::params::hiera5_defaults

backends

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']

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.

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: {}

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 value: $hiera::params::hiera_yaml

create_symlink

Data type: Any

Whether to create the symlink /etc/hiera.yaml

Default value: true

datadir

Data type: Any

The path to the directory where hiera will look for databases.

Default value: $hiera::params::datadir

datadir_manage

Data type: Any

Whether to create and manage the datadir as a file resource.

Default value: true

owner

Data type: Any

The owner of managed files and directories.

Default value: $hiera::params::owner

group

Data type: Any

The group owner of managed files and directories.

Default value: $hiera::params::group

mode

Data type: Any

Default value: $hiera::params::mode

eyaml_owner

Data type: Any

Default value: $hiera::params::eyaml_owner

eyaml_group

Data type: Any

Default value: $hiera::params::eyaml_group

provider

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

eyaml

Data type: Any

Whether to install, configure, and enable the eyaml backend. Also see the provider and master_service parameters.

Default value: false

eyaml_name

Data type: Any

The name of the eyaml gem.

Default value: 'hiera-eyaml'

eyaml_version

Data type: Any

The version of hiera-eyaml to install. Accepts 'installed', 'latest', '2.0.7', etc

Default value: undef

eyaml_source

Data type: Any

An alternate gem source for installing hiera-eyaml.

Default value: undef

eyaml_datadir

Data type: Any

The path to the directory where hiera will look for databases with the eyaml backend.

Default value: undef

eyaml_extension

Data type: Any

The file extension for the eyaml backend.

Default value: undef

confdir

Data type: Any

The path to Puppet's confdir.

Default value: $hiera::params::confdir

puppet_conf_manage

Data type: Any

Whether to manage the puppet.conf hiera_config value or not.

Default value: true

logger

Data type: Any

Which hiera logger to use. Note: You need to manage any package/gem dependencies yourself.

Default value: 'console'

cmdpath

Data type: Any

Search paths for command binaries, like the eyaml command. The default should cover most cases.

Default value: $hiera::params::cmdpath

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 value: true

keysdir

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

deep_merge_name

Data type: Any

The name of the deep_merge gem.

Default value: 'deep_merge'

deep_merge_version

Data type: Any

The version of deep_merge to install. Accepts 'installed', 'latest', '2.0.7', etc.

Default value: undef

deep_merge_source

Data type: Any

An alternate gem source for installing deep_merge.

Default value: undef

deep_merge_options

Data type: Any

A hash of options to set in hiera.yaml for the deep merge behavior.

Default value: {}

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 value: undef

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 value: ''

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 value: $hiera::params::master_service

manage_package

Data type: Any

A boolean for wether the hiera package should be managed.

Default value: $hiera::params::manage_package

manage_eyaml_package

Data type: Boolean

Default value: true

manage_deep_merge_package

Data type: Boolean

Default value: true

manage_eyaml_gpg_package

Data type: Boolean

Default value: true

package_name

Data type: Any

Specifies the name of the hiera package.

Default value: $hiera::params::package_name

package_ensure

Data type: Any

Specifies the ensure value of the hiera package.

Default value: $hiera::params::package_ensure

eyaml_gpg_name

Data type: Any

Default value: 'hiera-eyaml-gpg'

eyaml_gpg_version

Data type: Any

Default value: undef

eyaml_gpg_source

Data type: Any

Default value: undef

eyaml_gpg

Data type: Any

Default value: false

eyaml_gpg_gnupghome_recurse

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

eyaml_gpg_recipients

Data type: Any

Default value: undef

eyaml_pkcs7_private_key

Data type: Any

Default value: undef

eyaml_pkcs7_public_key

Data type: Any

Default value: undef

ruby_gpg_name

Data type: Any

Default value: 'ruby_gpg'

ruby_gpg_version

Data type: Any

Default value: undef

ruby_gpg_source

Data type: Any

Default value: undef

gem_install_options

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

gem_source

Data type: Any

Default value: undef

hiera::deep_merge

=== Copyright:

Copyright (C) 2016 Joseph Yaworski, unless otherwise noted.

hiera::eyaml_gpg

This calls install and configures hiera-eyaml-gpg

hiera::params

=== Copyright:

Copyright (C) 2013 Mike Arnold, unless otherwise noted.

Data types

Hiera::Hiera5_defaults

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],
                              }]

Hiera::Hiera5_hierarchy

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],
                                }]]