move absent cron.d files to one-line statements to make grepping easier
[mirror/dsa-puppet.git] / modules / exim / manifests / mx.pp
1 class exim::mx inherits exim {
2         include clamav
3         include postgrey
4
5         file { '/etc/exim4/ccTLD.txt':
6                 source => 'puppet:///modules/exim/common/ccTLD.txt',
7         }
8         file { '/etc/exim4/surbl_whitelist.txt':
9                 source => 'puppet:///modules/exim/common/surbl_whitelist.txt',
10         }
11         file { '/etc/exim4/exim_surbl.pl':
12                 source  => 'puppet:///modules/exim/common/exim_surbl.pl',
13                 notify  => Service['exim4'],
14         }
15
16         # MXs used as smarthosts
17         @ferm::rule { 'dsa-exim-submission':
18                 description => 'Allow SMTP',
19                 rule        => '&SERVICE_RANGE(tcp, submission, $SMTP_SOURCES)'
20         }
21         @ferm::rule { 'dsa-exim-v6-submission':
22                 description => 'Allow SMTP',
23                 domain      => 'ip6',
24                 rule        => '&SERVICE_RANGE(tcp, submission, $SMTP_V6_SOURCES)',
25         }
26         $autocertdir = hiera('paths.auto_certs_dir')
27         dnsextras::tlsa_record{ "tlsa-submission":
28                 zone => 'debian.org',
29                 certfile => "${autocertdir}/${::fqdn}.crt",
30                 port => 587,
31                 hostname => "$::fqdn",
32         }
33         package { 'nagios-plugins-standard':
34                 ensure => installed,
35         }
36
37         if has_role('mailrelay') {
38                 concat::fragment { 'dsa-puppet-stuff--email-virtualdomains':
39                         target => '/etc/cron.d/dsa-puppet-stuff',
40                         content  => @(EOF)
41                                 @hourly  root if [ ! -d /etc/exim4/email-virtualdomains ]; then cd /etc/exim4 && git clone mail-git:email-virtualdomains ; fi && cd /etc/exim4/email-virtualdomains && git pull --quiet --ff-only
42                                 | EOF
43                 }
44         }
45         file { '/etc/cron.d/dsa-email-virtualdomains': ensure => absent, }
46 }