bundlewrap/bundles/nftables/items.py

49 lines
1.3 KiB
Python
Raw Permalink Normal View History

2021-06-03 11:57:50 +00:00
if node.has_bundle('pacman'):
package = 'pkg_pacman:nftables'
else:
package = 'pkg_apt:nftables'
directories = {
# used by other bundles
'/etc/nftables-rules.d': {
'purge': True,
'triggers': {
'svc_systemd:nftables:reload',
},
},
}
files = {
'/etc/nftables.conf': {
2023-09-24 18:59:58 +00:00
'content_type': 'mako',
'context': {
'blocked_v4': node.metadata.get('nftables/blocked_v4', set()),
'blocked_v6': node.metadata.get('nftables/blocked_v6', set()),
2023-09-24 18:59:58 +00:00
'forward': node.metadata.get('nftables/forward', {}),
'input': node.metadata.get('nftables/input', {}),
'postrouting': node.metadata.get('nftables/postrouting', {}),
'prerouting': node.metadata.get('nftables/prerouting', {}),
2021-06-03 11:57:50 +00:00
},
'triggers': {
'svc_systemd:nftables:reload',
},
},
2021-06-04 05:27:49 +00:00
'/etc/systemd/system/nftables.service.d/bundlewrap.conf': {
'source': 'override.conf',
'content_type': 'mako',
2021-06-04 05:27:49 +00:00
'triggers': {
'action:systemd-reload',
'svc_systemd:nftables:reload',
},
},
2021-06-03 11:57:50 +00:00
}
svc_systemd = {
'nftables': {
'needs': {
'file:/etc/nftables.conf',
package,
},
},
}