blob: 423d5cfab7243a9044294be397480b6c9e55aba2 (
plain)
1
2
3
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
44
45
46
47
|
class proxmox::proxy ($mail, $base_hostname) {
package {'apache2':}
->
service {'apache2':
enable => true,
ensure => running,
require => File['/usr/local/bin/notify_md_renewal'],
}
$apache_dep = {
require => Package['apache2'],
notify => Service['apache2'],
}
['md', 'ssl'].each |$mod| {
exec {"/usr/sbin/a2enmod $mod":
creates => "/etc/apache2/mods-enabled/$mod.load",
* => $apache_dep,
}
}
file {'/etc/apache2/sites-enabled/test.conf':
content => @("EOT")
MDomain $base_hostname
MDCertificateAgreement accepted
MDContactEmail $mail
MDNotifyCmd /usr/local/bin/notify_md_renewal
<VirtualHost *:443>
ServerName $base_hostname
SSLEngine on
</VirtualHost>
| EOT
,
* => $apache_dep
}
file {'/usr/local/bin/notify_md_renewal':
content => @("EOT"/$)
#!/bin/sh
mail $mail -s "Restart apache2 on $base_hostname for certificate \$1" </dev/null
| EOT
,
mode => '0755',
}
}
|