-
Notifications
You must be signed in to change notification settings - Fork 4
/
init.pp
35 lines (31 loc) · 890 Bytes
/
init.pp
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
class mailman(
$mailman_password,
$postmaster = "postmaster@${::domain}",
) {
package {'mailman':
ensure => present,
}
if $::os['name'] == 'Debian' and $::os['release']['major'] == '7' {
$stale_opt = ''
} else {
$stale_opt = '-s '
}
service {'mailman':
ensure => running,
require => Package['mailman'],
hasstatus => false,
hasrestart => true,
pattern => "/usr/lib/mailman/bin/mailmanctl ${stale_opt}-q start",
}
# Based on mmsitepass python script, we do not need to use it
# as it simply output the SHA1 in a file. This file cannot be configured
# in mailman options. We just have to take care of the file rights.
$hased_pass = sha1($mailman_password)
file {'/var/lib/mailman/data/adm.pw':
ensure => file,
owner => 'root',
group => 'list',
mode => '0640',
content => $hased_pass,
}
}