Puppet Class: puppetdb::master::puppetdb_conf

Inherits:
puppetdb::params
Defined in:
manifests/master/puppetdb_conf.pp

Summary

manage the puppetdb.conf file on the puppet primary

Overview

Parameters:

  • server (Any) (defaults to: 'localhost')
  • port (Any) (defaults to: '8081')
  • soft_write_failure (Any) (defaults to: $puppetdb::disable_ssl ? { true => true, default => false)
  • puppet_confdir (Any) (defaults to: $puppetdb::params::puppet_confdir)
  • legacy_terminus (Any) (defaults to: $puppetdb::params::terminus_package ? { /(puppetdb-terminus)/ => true, default => false)


4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
# File 'manifests/master/puppetdb_conf.pp', line 4

class puppetdb::master::puppetdb_conf (
  $server             = 'localhost',
  $port               = '8081',
  $soft_write_failure = $puppetdb::disable_ssl ? {
    true => true,
    default => false,
  },
  $puppet_confdir     = $puppetdb::params::puppet_confdir,
  $legacy_terminus    = $puppetdb::params::terminus_package ? {
    /(puppetdb-terminus)/ => true,
    default               => false,
  },
) inherits puppetdb::params {
  Ini_setting {
    ensure  => present,
    section => 'main',
    path    => "${puppet_confdir}/puppetdb.conf",
  }

  if $legacy_terminus {
    ini_setting { 'puppetdbserver':
      setting => 'server',
      value   => $server,
    }
    ini_setting { 'puppetdbport':
      setting => 'port',
      value   => $port,
    }
  } else {
    ini_setting { 'puppetdbserver_urls':
      setting => 'server_urls',
      value   => "https://${server}:${port}/",
    }
  }

  ini_setting { 'soft_write_failure':
    setting => 'soft_write_failure',
    value   => $soft_write_failure,
  }
}