bundles/iptables: add newline to rules files

This commit is contained in:
Franzi 2020-11-14 12:24:12 +01:00
parent 877744b0ba
commit 32b7dda61f
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -28,7 +28,7 @@ files = {
for bundle, rules in node.metadata.get('iptables', {}).get('bundle_rules', {}).items(): for bundle, rules in node.metadata.get('iptables', {}).get('bundle_rules', {}).items():
files[f'/etc/iptables-rules.d/20-{bundle}'] = { files[f'/etc/iptables-rules.d/20-{bundle}'] = {
# We must never use sorted() here. Bundles might rely on their order. # We must never use sorted() here. Bundles might rely on their order.
'content': '\n'.join(rules), 'content': '\n'.join(rules) + '\n',
'triggers': { 'triggers': {
'action:iptables_enforce', 'action:iptables_enforce',
}, },
@ -36,7 +36,7 @@ for bundle, rules in node.metadata.get('iptables', {}).get('bundle_rules', {}).i
if 'custom_rules' in node.metadata.get('iptables', {}): if 'custom_rules' in node.metadata.get('iptables', {}):
files[f'/etc/iptables-rules.d/40-custom'] = { files[f'/etc/iptables-rules.d/40-custom'] = {
'content': '\n'.join(node.metadata['iptables']['custom_rules']), 'content': '\n'.join(node.metadata['iptables']['custom_rules']) + '\n',
'triggers': { 'triggers': {
'action:iptables_enforce', 'action:iptables_enforce',
}, },