2 Boolean $insecure_ssl = false
10 package { 'ca-certificates':
15 $extra_ssl_certs_flags = ' --default'
16 $ssl_certs_config = 'puppet:///modules/ssl/ca-certificates-global.conf'
18 $extra_ssl_certs_flags = ''
19 $ssl_certs_config = 'puppet:///modules/ssl/ca-certificates.conf'
22 file { '/etc/ssl/README':
24 source => 'puppet:///modules/ssl/README',
26 file { '/etc/ca-certificates.conf':
27 source => $ssl_certs_config,
28 notify => Exec['refresh_normal_hashes'],
30 file { '/etc/ca-certificates-debian.conf':
32 source => 'puppet:///modules/ssl/ca-certificates.conf',
33 notify => Exec['refresh_ca_debian_hashes'],
35 file { '/etc/ca-certificates-global.conf':
36 source => 'puppet:///modules/ssl/ca-certificates-global.conf',
37 notify => Exec['refresh_ca_global_hashes'],
40 file { '/etc/ssl/certs/ssl-cert-snakeoil.pem':
42 notify => Exec['refresh_normal_hashes'],
44 file { '/etc/ssl/private/ssl-cert-snakeoil.key':
48 file { '/etc/ssl/servicecerts':
52 file { '/usr/local/share/ca-certificates/debian.org':
57 notify => [ Exec['refresh_normal_hashes'], Exec['refresh_ca_global_hashes'] ],
59 file { '/etc/ssl/certs/README':
62 file { '/etc/ssl/ca-debian':
66 file { '/etc/ssl/ca-debian/README':
69 file { '/etc/ssl/ca-global':
73 file { '/etc/ssl/ca-global/README':
76 file { '/etc/ssl/debian':
78 source => 'puppet:///files/empty/',
79 mode => '0644', # this works; otherwise all files are +x
84 file { '/etc/ssl/debian/certs':
88 file { '/etc/ssl/debian/crls':
92 file { '/etc/ssl/debian/certs/thishost.crt':
93 content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_clientcerts_dir"]) + "/" + @fqdn + ".client.crt") %>'),
94 notify => Exec['refresh_debian_hashes'],
96 file { '/etc/ssl/debian/certs/ca.crt':
97 content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_clientcerts_dir"]) + "/ca.crt") %>'),
98 notify => Exec['refresh_debian_hashes'],
100 file { '/etc/ssl/debian/crls/ca.crl':
101 content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_clientcerts_dir"]) + "/ca.crl") %>'),
103 file { '/etc/ssl/debian/certs/thishost-server.crt':
104 content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_certs_dir"]) + "/" + @fqdn + ".crt") %>'),
105 notify => Exec['refresh_debian_hashes'],
108 file { '/etc/ssl/debian/keys/thishost.key':
111 file { '/etc/ssl/debian/keys/thishost-server.key':
114 file { '/etc/ssl/debian/keys':
118 file { '/etc/ssl/private/thishost.key':
119 content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_clientcerts_dir"]) + "/" + @fqdn + ".key") %>'),
122 require => Package['ssl-cert'],
124 file { '/etc/ssl/private/thishost-server.key':
125 content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_certs_dir"]) + "/" + @fqdn + ".key") %>'),
128 require => Package['ssl-cert'],
131 $updatecacertsdsa = '/usr/local/sbin/update-ca-certificates-dsa'
132 if (versioncmp($::lsbmajdistrelease, '9') >= 0) {
133 file { $updatecacertsdsa:
136 $updatecacerts = '/usr/sbin/update-ca-certificates'
138 file { $updatecacertsdsa:
140 source => 'puppet:///modules/ssl/update-ca-certificates-dsa',
142 $updatecacerts = $updatecacertsdsa
145 file { '/etc/apt/apt.conf.d/local-ssl-ca-global':
147 content => template('ssl/local-ssl-ca-global.erb'),
151 exec { 'refresh_debian_hashes':
152 command => 'c_rehash /etc/ssl/debian/certs',
154 require => Package['openssl'],
157 exec { 'refresh_normal_hashes':
158 # NOTE 1: always use update-ca-certificates to manage hashes in
159 # /etc/ssl/certs otherwise /etc/ssl/ca-certificates.crt will
160 # get a hash overriding the hash that would have been generated
161 # for another certificate ... which is problem, comrade
162 # NOTE 2: always ask update-ca-certificates to freshen (-f) the links
163 command => "/usr/sbin/update-ca-certificates --fresh${extra_ssl_certs_flags}",
165 require => Package['ca-certificates'],
167 exec { 'refresh_ca_debian_hashes':
168 command => "${updatecacerts} --fresh --certsconf /etc/ca-certificates-debian.conf --localcertsdir /dev/null --etccertsdir /etc/ssl/ca-debian --hooksdir /dev/null",
171 Package['ca-certificates'],
172 File['/etc/ssl/ca-debian'],
173 File['/etc/ca-certificates-debian.conf'],
174 File[$updatecacertsdsa],
177 exec { 'refresh_ca_global_hashes':
178 command => "${updatecacerts} --fresh --default --certsconf /etc/ca-certificates-global.conf --etccertsdir /etc/ssl/ca-global --hooksdir /dev/null",
181 Package['ca-certificates'],
182 File['/etc/ssl/ca-global'],
183 File['/etc/ca-certificates-global.conf'],
184 File[$updatecacertsdsa],