Puppet Class: puppet::storeconfig

Defined in:
manifests/storeconfig.pp

Overview

Class: puppet::storeconfig

This class installs and configures Puppet’s stored configuration capability

Parameters:

Actions:

Requires:

Sample Usage:

Parameters:

  • backend (Any) (defaults to: '')
  • dbuser (Any) (defaults to: 'puppet')
  • dbpassword (Any) (defaults to: '')
  • dbserver (Any) (defaults to: 'localhost')
  • dbsocket (Any) (defaults to: '')


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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'manifests/storeconfig.pp', line 13

class puppet::storeconfig (
    $backend    = '',
    $dbuser     = 'puppet',
    $dbpassword = '',
    $dbserver   = 'localhost',
    $dbsocket   = ''
) {

  include puppet
  include puppet::params

  #$puppet::storeconfigs = 'true' # called from puppet::server only if storeconfigs is on

  Ini_setting {
    ensure  => 'present',
    section => 'master',
    path    => $puppet::params::puppet_conf,
  }

  if $backend != '' {
    ini_setting {
      'storeconfigs':
        setting => 'storeconfigs',
        value   => 'true';
      'thin_storeconfigs':
        setting => 'thin_storeconfigs',
        value   => 'true';
    }
  } else {
    ini_setting {
      'storeconfigs':
        setting => 'storeconfigs',
        value   => 'false';
      'thin_storeconfigs':
        ensure  => 'absent',
        setting => 'thin_storeconfigs';
    }
  }

  case $backend {
    "mysql","postgresql","sqlite": {
      package { "gem-activerecord":
        name => $operatingsystem ? {
          "Debian" => "libactiverecord-ruby",
          "Darwin" => "rb-activerecord",
          default  => activerecord,
        },
        provider => $operatingsystem ? {
          "Debian" => apt,
          "Darwin" => macports,
          default  => gem,
        },
      }
    }
  }

  case $backend {
    'sqlite3': {
      include puppet::storeconfig::sqlite
    }
    'mysql': {
      class { "puppet::storeconfig::mysql":
          dbuser     => $dbuser,
          dbpassword => $dbpassword,
      }
    }
    'postgresql': {
      class { "puppet::storeconfig::postgresql":
          dbuser     => $dbuser,
          dbpassword => $dbpassword,
      }
    }
    'puppetdb': {
      class {'::puppet::storeconfig::puppetdb': }
    }
    default: { err("Target storeconfigs backend \"$backend\" not implemented") }
  }
}