Try to replace file access to auto-ca things with templates
[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                 file { '/etc/cron.d/dsa-email-virtualdomains':
39                         source => 'puppet:///modules/exim/dsa-email-virtualdomains.cron',
40                 }
41         } else {
42                 file { '/etc/cron.d/dsa-email-virtualdomains':
43                         ensure => absent,
44                 }
45         }
46 }