Puppet Class: foreman::plugin::puppetdb

Inherits:
foreman::params
Defined in:
manifests/plugin/puppetdb.pp

Summary

Install the puppetdb_foreman plugin

Overview

Parameters:

  • address (Stdlib::HTTPUrl) (defaults to: 'https://localhost:8081/pdb/cmd/v1')

    Address of puppetdb API.

  • ssl_ca_file (String) (defaults to: $foreman::params::client_ssl_ca)

    CA certificate file which will be used to connect to the PuppetDB API.

  • ssl_certificate (String) (defaults to: $foreman::params::client_ssl_cert)

    Certificate file which will be used to connect to the PuppetDB API.

  • ssl_private_key (String) (defaults to: $foreman::params::client_ssl_key)

    Private key file which will be used to connect to the PuppetDB API.

  • api_version (Enum['1', '3', '4']) (defaults to: '4')

    PuppetDB API version.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'manifests/plugin/puppetdb.pp', line 18

class foreman::plugin::puppetdb (
  Stdlib::HTTPUrl $address = 'https://localhost:8081/pdb/cmd/v1',
  String $ssl_ca_file = $foreman::params::client_ssl_ca,
  String $ssl_certificate = $foreman::params::client_ssl_cert,
  String $ssl_private_key = $foreman::params::client_ssl_key,
  Enum['1', '3', '4'] $api_version = '4',
) inherits foreman::params {
  foreman::plugin { 'puppetdb':
    package => $foreman::params::plugin_prefix.regsubst(/foreman[_-]/, 'puppetdb_foreman'),
  }

  $config = {
    'puppetdb_enabled'         => true,
    'puppetdb_address'         => $address,
    'puppetdb_ssl_ca_file'     => $ssl_ca_file,
    'puppetdb_ssl_certificate' => $ssl_certificate,
    'puppetdb_ssl_private_key' => $ssl_private_key,
    'puppetdb_api_version'     => $api_version,
  }

  $config.each |$setting, $value| {
    foreman_config_entry { $setting:
      value   => $value,
      require => Class['foreman::database'],
    }
  }
}