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