X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fexim%2Fmanifests%2Finit.pp;h=babfa449886bcb1b5450405ca8b01780b4aa53d5;hb=ad216612f9a38a69288abbf4f2b05964467249c9;hp=e83a9dfb8be0b852c6246300639a7177ba60765a;hpb=ec37b63d7ed277542e0d2e2fc2fff10ce6acaf72;p=mirror%2Fdsa-puppet.git diff --git a/modules/exim/manifests/init.pp b/modules/exim/manifests/init.pp index e83a9dfb8..babfa4498 100644 --- a/modules/exim/manifests/init.pp +++ b/modules/exim/manifests/init.pp @@ -1,13 +1,38 @@ -class exim { +# our exim class +# @param use_smarthost use the smarthost +# @param smarthost host to relay through (if set and use_smarthost) +# @param is_bugsmx this system handles bugs.debian.org +# @param is_mailrelay this system is a mailrelay, both in and out, for debian hosts +# @param is_rtmaster this system handles rt.debian.org +# @param is_packagesmaster this system handles packages.debian.org +# @param is_packagesqamaster this system handles packages.qa.debian.org +# @param is_trackermaster this system handles tracker.debian.org +# @param mail_port override the default incoming mailport (only applicable for hosts behind an incoming relay) +# @param smarthost_port the port on which satellites send mail to the smarthost (needs to be the same on both sides) +class exim ( + Optional[String] $smarthost, + Boolean $use_smarthost = true, + Boolean $is_bugsmx = false, + Boolean $is_mailrelay = false, + Boolean $is_rtmaster = false, + Boolean $is_packagesmaster = false, + Boolean $is_packagesqamaster = false, + Boolean $is_trackermaster = false, + Integer $smarthost_port = 587, + Optional[Integer] $mail_port = undef, +) { + if $use_smarthost { + $heavy = false - $is_mailrelay = has_role('mailrelay') - $is_bugsmx = has_role('bugsmx') - $is_rtmaster = has_role('rtmaster') - $is_packagesmaster = has_role('packagesmaster') - $is_packagesqamaster = has_role('packagesqamaster') - - include exim::vdomain::setup - include debian_org::mail_incoming_port + if ! smarthost { + fail('No smarthost set but use_smarthost is true') + } + } else { + $heavy = true + if $mail_port { + fail('Cannot override mail_port in heavy/no-smarthost hosts') + } + } munin::check { 'ps_exim4': script => 'ps_' } munin::check { 'exim_mailqueue': } @@ -21,12 +46,6 @@ class exim { Package['exim4-daemon-heavy']->Mailalias<| |> - concat::fragment { 'virtual_domain_template': - target => '/etc/exim4/virtualdomains', - content => template('exim/virtualdomains.erb'), - order => '05', - } - service { 'exim4': ensure => running, require => [ @@ -62,15 +81,25 @@ class exim { file { '/etc/mailname': content => template('exim/mailname.erb'), } - file { '/etc/exim4/manualroute': - content => template('exim/manualroute.erb') + + concat { '/etc/exim4/virtualdomains': } + concat::fragment { 'virtualdomains_header': + target => '/etc/exim4/virtualdomains', + content => template('exim/virtualdomains.header.erb'), + order => '00', } + file { '/etc/exim4/locals': content => template('exim/locals.erb') } - file { '/etc/exim4/submission-domains': - content => template('exim/submission-domains.erb'), + + concat { '/etc/exim4/submission-domains': + ensure_newline => true, + warn => @(EOF), + ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE. + | EOF } + file { '/etc/exim4/host_blacklist': source => 'puppet:///modules/exim/common/host_blacklist', }