Puppet Class: confdroid_puppet::puppetdb::files

Inherits:
confdroid_puppet::params
Defined in:
manifests/puppetdb/files.pp

Summary

Class manages config files for the puppetdb section

Overview

confdroid_puppet::puppetdb::files.pp Module name: confdroid_puppet Author: Arne Teuke (arne_teuke@confdroid)



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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'manifests/puppetdb/files.pp', line 6

class confdroid_puppet::puppetdb::files (

) inherits confdroid_puppet::params {
  if ($pt_use_puppetdb == true) and ($pt_puppetdb_fqdn == $fqdn) {
    require confdroid_puppet::puppetdb::dirs

    # bootstrap.cfg
    file { $pt_bootstrap_conf_file:
      ensure   => file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => puppet_etc_t,
      seluser  => system_u,
      content  => template($pt_bootstrap_conf_erb),
      notify   => Service[$pt_db_service],
    }
    # logback.xml
    file { $pt_logback_conf_file:
      ensure   => file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => puppet_etc_t,
      seluser  => system_u,
      content  => template($pt_logback_conf_erb),
      notify   => Service[$pt_db_service],
    }
    # request-logging.xml
    file { $pt_logging_conf_file:
      ensure   => file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => puppet_etc_t,
      seluser  => system_u,
      content  => template($pt_logging_conf_erb),
      notify   => Service[$pt_db_service],
    }
    # service config
    file { $pt_service_conf_file:
      ensure   => file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => systemd_unit_file_t,
      seluser  => system_u,
      content  => template($pt_service_conf_erb),
      notify   => Service[$pt_db_service],
    }
    # conf.d files
    ## auth.conf
    file { $pt_auth_conf_file:
      ensure   => file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => puppet_etc_t,
      seluser  => system_u,
      content  => template($pt_auth_conf_erb),
      notify   => Service[$pt_db_service],
    }
    # config.ini
    file { $pt_config_ini_file:
      ensure   => file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => puppet_etc_t,
      seluser  => system_u,
      content  => template($pt_config_ini_erb),
      notify   => Service[$pt_db_service],
    }
    # database.ini
    file { $pt_db_ini_file:
      ensure   => file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => puppet_etc_t,
      seluser  => system_u,
      content  => template($pt_db_ini_erb),
      notify   => Service[$pt_db_service],
    }
    # jetty.ini
    file { $pt_jetty_ini_file:
      ensure   => file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => puppet_etc_t,
      seluser  => system_u,
      content  => template($pt_jetty_ini_erb),
      notify   => Service[$pt_db_service],
    }
    # repl.ini
    file { $pt_repl_ini_file:
      ensure   => file,
      owner    => 'root',
      group    => 'root',
      mode     => '0644',
      selrange => s0,
      selrole  => object_r,
      seltype  => puppet_etc_t,
      seluser  => system_u,
      content  => template($pt_repl_ini_erb),
      notify   => Service[$pt_db_service],
    }
    if $pt_enable_tls == true {
      # create tls certs
      ## ca.crt
      file { $pt_ca_crt_file:
        ensure   => file,
        owner    => 'puppetdb',
        group    => 'puppetdb',
        mode     => '0440',
        selrange => s0,
        selrole  => object_r,
        seltype  => puppet_etc_t,
        seluser  => system_u,
        content  => template($pt_ca_crt_erb),
        notify   => Service[$pt_db_service],
      }
      ## server.crt
      file { $pt_server_crt_file:
        ensure   => file,
        owner    => 'puppetdb',
        group    => 'puppetdb',
        mode     => '0440',
        selrange => s0,
        selrole  => object_r,
        seltype  => puppet_etc_t,
        seluser  => system_u,
        content  => template($pt_server_crt_erb),
        notify   => Service[$pt_db_service],
      }
      ## server.key
      file { $pt_server_key_file:
        ensure   => file,
        owner    => 'puppetdb',
        group    => 'puppetdb',
        mode     => '0440',
        selrange => s0,
        selrole  => object_r,
        seltype  => puppet_etc_t,
        seluser  => system_u,
        content  => template($pt_server_key_erb),
        notify   => Service[$pt_db_service],
      }
    }
  }
}