postfix: whether or not we touch main.cf is not dependent on membership in the lists...
[mirror/dsa-puppet.git] / modules / postfix / manifests / init.pp
1 class postfix(
2   Boolean $manage_maincf = true,
3 ) {
4   package { 'postfix':
5     ensure => installed
6   }
7
8   service { 'postfix':
9     ensure => running
10   }
11
12   include debian_org::mail_incoming_port
13
14   munin::check { 'ps_exim4':       ensure => absent }
15   munin::check { 'exim_mailqueue': ensure => absent }
16   munin::check { 'exim_mailstats': ensure => absent }
17
18   munin::check { 'postfix_mailqueue': }
19   munin::check { 'postfix_mailstats': }
20   munin::check { 'postfix_mailvolume': }
21   munin::check { 'ps_smtp': script => 'ps_' }
22   munin::check { 'ps_smtpd': script => 'ps_' }
23
24   if $manage_maincf {
25     concat { '/etc/postfix/main.cf':
26       notify  => Exec['service postfix reload'],
27     }
28     concat::fragment { 'puppet-postfix-main.cf--header':
29       target  => '/etc/postfix/main.cf',
30       order   => '000',
31       content => template('postfix/main.cf-header.erb')
32     }
33   } else {
34     include fail2ban::postfix
35   }
36
37   exec { 'service postfix reload':
38     path        => '/usr/bin:/usr/sbin:/bin:/sbin',
39     command     => 'service postfix reload',
40     refreshonly => true,
41     require     =>  Package['postfix'],
42   }
43 }