bundles/postfix: add SPAM BLOCKLIST check for every non-private IP attached to the server
All checks were successful
bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2021-03-22 20:24:14 +01:00
parent b99176be49
commit fdcec012f3
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 109 additions and 0 deletions

View file

@ -4,6 +4,7 @@ defaults = {
'apt': {
'packages': {
'postfix': {},
'python3-dnsq': {},
},
},
'icinga2_api': {
@ -91,3 +92,28 @@ def iptables(metadata):
'port_rules': rules,
},
}
@metadata_reactor.provides(
'icinga2_api/postfix/services',
)
def icinga2(metadata):
services = {}
for ip_type in repo.libs.tools.resolve_identifier(repo, node.name).values():
for ip in ip_type:
if not ip.is_private:
services[f'SPAM BLOCKLIST {ip}'] = {
'command_on_monitored_host': f'/usr/local/share/icinga/plugins/check_spam_blocklist {ip}',
'vars.sshmon_timeout': 60,
'check_interval': '15m',
'retry_interval': '5m',
}
return {
'icinga2_api': {
'postfix': {
'services': services,
},
},
}