7878d35587
ci/woodpecker/pr/erb-validate Pipeline was successful
ci/woodpecker/pr/ruby-validate Pipeline was successful
ci/woodpecker/pr/yamllint Pipeline was successful
ci/woodpecker/pr/puppet-lint Pipeline was successful
ci/woodpecker/pr/bolt-validate Pipeline was successful
ci/woodpecker/pr/epp-validate Pipeline was successful
ci/woodpecker/pr/puppet-validate Pipeline was successful
ci/woodpecker/pr/ruby-check Pipeline was successful
52 lines
1.2 KiB
Puppet
52 lines
1.2 KiB
Puppet
# local rspamd milter for the mail edge gateways
|
|
# - local_d: /etc/rspamd/local.d file name => content
|
|
# - rules: /etc/rspamd/rules file name => url, re-fetched every puppet run
|
|
class profiles::rspamd::edge (
|
|
Hash[String, String] $local_d = {},
|
|
Hash[String, Stdlib::HTTPSUrl] $rules = {},
|
|
) {
|
|
|
|
package { 'rspamd':
|
|
ensure => installed,
|
|
}
|
|
|
|
$local_d.each |$name, $content| {
|
|
file { "/etc/rspamd/local.d/${name}":
|
|
ensure => file,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
content => $content,
|
|
require => Package['rspamd'],
|
|
notify => Service['rspamd'],
|
|
}
|
|
}
|
|
|
|
file { '/etc/rspamd/rules':
|
|
ensure => directory,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0755',
|
|
require => Package['rspamd'],
|
|
}
|
|
|
|
$rules.each |$name, $url| {
|
|
file { "/etc/rspamd/rules/${name}":
|
|
ensure => file,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
source => $url,
|
|
notify => Service['rspamd'],
|
|
}
|
|
}
|
|
|
|
# reload keeps the milter answering while config changes apply
|
|
service { 'rspamd':
|
|
ensure => running,
|
|
enable => true,
|
|
restart => '/usr/bin/systemctl reload rspamd',
|
|
require => Package['rspamd'],
|
|
}
|
|
}
|