Merge remote-tracking branch 'origin/benvin/mail-edge-dnsmasq' into benvin/mail-edge-base
This commit is contained in:
@@ -153,8 +153,10 @@ profiles::yum::global::repos:
|
|||||||
name: rspamd
|
name: rspamd
|
||||||
descr: rspamd repository
|
descr: rspamd repository
|
||||||
target: /etc/yum.repos.d/rspamd.repo
|
target: /etc/yum.repos.d/rspamd.repo
|
||||||
baseurl: https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/rspamd/rpm-stable/centos-%{facts.os.release.major}/%{facts.os.architecture}
|
baseurl: https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/rspamd/rpm-stable/centos-%{facts.os.release.major}/x86_64
|
||||||
gpgkey: https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/rspamd/rpm/rspamd.asc
|
gpgkey: https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/rspamd/rpm/rspamd.asc
|
||||||
|
gpgcheck: 1
|
||||||
|
repo_gpgcheck: 1
|
||||||
mirrorlist: absent
|
mirrorlist: absent
|
||||||
|
|
||||||
# Ceph repositories
|
# Ceph repositories
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class profiles::postfix::gateway (
|
|||||||
'postscreen_dnsbl_threshold' => {
|
'postscreen_dnsbl_threshold' => {
|
||||||
'value' => '2'
|
'value' => '2'
|
||||||
},
|
},
|
||||||
# el9 ships postfix 3.5, before the allowlist rename
|
# dnswl-listed clients (net score <= -1) skip the slow greet tests; el9 postfix 3.5 predates the allowlist rename
|
||||||
'postscreen_dnsbl_whitelist_threshold' => {
|
'postscreen_dnsbl_whitelist_threshold' => {
|
||||||
'value' => '-1'
|
'value' => '-1'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# local rspamd milter for the mail edge gateways
|
# local rspamd milter for the mail edge gateways
|
||||||
# - local_d: /etc/rspamd/local.d file name => content
|
# - local_d: /etc/rspamd/local.d file name => content
|
||||||
# - rules: /etc/rspamd/rules file name => url, re-fetched every puppet run
|
# - rules: /etc/rspamd/rules file name => url, re-fetched every puppet run; fetch failures keep the last good copy
|
||||||
class profiles::rspamd::edge (
|
class profiles::rspamd::edge (
|
||||||
Hash[String, String] $local_d = {},
|
Hash[String, String] $local_d = {},
|
||||||
Hash[String, Stdlib::HTTPSUrl] $rules = {},
|
Hash[String, Stdlib::HTTPSUrl] $rules = {},
|
||||||
@@ -31,13 +31,24 @@ class profiles::rspamd::edge (
|
|||||||
}
|
}
|
||||||
|
|
||||||
$rules.each |$name, $url| {
|
$rules.each |$name, $url| {
|
||||||
file { "/etc/rspamd/rules/${name}":
|
$path = "/etc/rspamd/rules/${name}"
|
||||||
ensure => file,
|
|
||||||
owner => 'root',
|
# empty placeholder so rspamd starts before the first successful fetch
|
||||||
group => 'root',
|
file { $path:
|
||||||
mode => '0644',
|
ensure => file,
|
||||||
source => $url,
|
owner => 'root',
|
||||||
notify => Service['rspamd'],
|
group => 'root',
|
||||||
|
mode => '0644',
|
||||||
|
content => '',
|
||||||
|
replace => false,
|
||||||
|
}
|
||||||
|
|
||||||
|
# a failed or unchanged fetch skips the swap without failing the run
|
||||||
|
exec { "rspamd_rules_fetch_${name}":
|
||||||
|
command => "/usr/bin/mv -f ${path}.new ${path}",
|
||||||
|
onlyif => "/usr/bin/curl -fsS --max-time 30 -o ${path}.new ${url} && ! /usr/bin/cmp -s ${path}.new ${path}",
|
||||||
|
require => File[$path],
|
||||||
|
notify => Exec['rspamd_reload'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,4 +59,10 @@ class profiles::rspamd::edge (
|
|||||||
restart => '/usr/bin/systemctl reload rspamd',
|
restart => '/usr/bin/systemctl reload rspamd',
|
||||||
require => Package['rspamd'],
|
require => Package['rspamd'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exec { 'rspamd_reload':
|
||||||
|
command => '/usr/bin/systemctl reload rspamd',
|
||||||
|
refreshonly => true,
|
||||||
|
require => Service['rspamd'],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user