From e143e95a9bd27ba77fb02aa8e02e665a0ada6382 Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Tue, 1 Oct 2019 13:55:34 +0100 Subject: [PATCH] exim: build submission domain list dynamically and have the bugs_master role declare that it handles bugs.d.o Signed-off-by: Adam D. Barratt --- modules/exim/manifests/init.pp | 11 +++++++++-- modules/exim/manifests/submission-domain.pp | 11 +++++++++++ modules/exim/templates/submission-domains.erb | 8 -------- modules/roles/manifests/bugs_master.pp | 1 + 4 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 modules/exim/manifests/submission-domain.pp delete mode 100644 modules/exim/templates/submission-domains.erb diff --git a/modules/exim/manifests/init.pp b/modules/exim/manifests/init.pp index 0064c8e78..974676301 100644 --- a/modules/exim/manifests/init.pp +++ b/modules/exim/manifests/init.pp @@ -90,9 +90,16 @@ class exim ( 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 + target => '/etc/exim4/submission-domains', + order => '00', } + file { '/etc/exim4/host_blacklist': source => 'puppet:///modules/exim/common/host_blacklist', } diff --git a/modules/exim/manifests/submission-domain.pp b/modules/exim/manifests/submission-domain.pp new file mode 100644 index 000000000..ea7b37f46 --- /dev/null +++ b/modules/exim/manifests/submission-domain.pp @@ -0,0 +1,11 @@ +# add an exim submission domain entry on this host +# +# @param domain email domain (defaults to $name) +define exim::submissiondomain ( + String $domain = $name, +) { + concat::fragment { "submission_${domain}": + target => '/etc/exim4/submission-domains', + content => $domain, + } +} diff --git a/modules/exim/templates/submission-domains.erb b/modules/exim/templates/submission-domains.erb deleted file mode 100644 index f45b07d85..000000000 --- a/modules/exim/templates/submission-domains.erb +++ /dev/null @@ -1,8 +0,0 @@ -## -### THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE. -### USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git -### - -<% if %w{buxtehude}.include?( scope.lookupvar('::hostname') ) %> -bugs.debian.org -<% end %> diff --git a/modules/roles/manifests/bugs_master.pp b/modules/roles/manifests/bugs_master.pp index 3df3c7c54..c366d0cbb 100644 --- a/modules/roles/manifests/bugs_master.pp +++ b/modules/roles/manifests/bugs_master.pp @@ -11,6 +11,7 @@ class roles::bugs_master { } # The bugs service accepts bug reports on the submission port + exim::submissiondomain { 'bugs.debian.org': } ferm::rule::simple { 'bugs-submission': description => 'Allow submission access from the world', port => 'submission', -- 2.20.1