Merge branch 'master' of ssh://pwan.org/var/www/git/projects/hgr
[hgr.git] / manifests / postfix.pp
1 class hgr::postfix {
2
3 package {
4 "exim4":
5 ensure => absent;
6 "postfix":
7 ensure => installed;
8 "sasl2-bin":
9 ensure => installed;
10 "libsasl2-2":
11 ensure => installed;
12 "libsasl2-modules":
13 ensure => installed;
14 "procmail":
15 ensure => installed;
16 }
17
18 file {
19
20 "/etc/postfix/main.cf":
21 ensure => present,
22 content => template("hgr/postfix/main.cf.erb"),
23 owner => "root",
24 group => "root",
25 mode => "0644",
26 notify => Service["postfix"],
27 require => [Package["postfix"],File["/etc/ssl/certs/${::fqdn}.pem"],File["/etc/ssl/private/${::fqdn}.key"],File["/etc/ssl/certs/${::fqdn}-CA.pem"]];
28
29 "/etc/postfix/master.cf":
30 ensure => present,
31 source => "puppet:///modules/hgr/postfix/master.cf",
32 owner => "root",
33 group => "root",
34 mode => "0644",
35 notify => Service["postfix"],
36 require => [Package["postfix","spamassassin"]];
37 # TODO: need to run portmap on this file after updating it / before restarting postfix
38 "/etc/postfix/send_access":
39 ensure => present,
40 owner => "root",
41 group => "root",
42 mode => "0644",
43 notify => Service["postfix"],
44 require => Package["postfix"];
45 "/etc/procmailrc":
46 ensure => present,
47 source => "puppet:///modules/hgr/procmailrc",
48 owner => "root",
49 group => "root",
50 mode => "0644",
51 require => Package["procmail"];
52 }
53
54 service {
55 "postfix":
56 ensure => running,
57 enable => true,
58 require => Package["postfix"];
59 }
60 }