From 8f22bec689b52bb4f1c181c899dc5787788af77a Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Wed, 15 Sep 2021 04:30:43 +0500 Subject: [PATCH] Allow to init iptables rules --- defaults/main.yml | 4 ++++ templates/rules.v4 | 4 +++- templates/rules.v6 | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index dd07cb3..8fe5344 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,6 +3,10 @@ iptables__state: install iptables__drop_by_default: false iptables__allow_output_ifaces: [] +iptables__v4_filter_init: null +iptables__v6_filter_init: null +iptables__all_filter_init: null + iptables__v4_filter_prepend: null iptables__v6_filter_prepend: null iptables__all_filter_prepend: null diff --git a/templates/rules.v4 b/templates/rules.v4 index f354a16..82bc0f9 100644 --- a/templates/rules.v4 +++ b/templates/rules.v4 @@ -29,8 +29,10 @@ COMMIT -F -X -{{ iptables__v4_filter_prepend }} +{{ iptables__v4_filter_init }} +{{ iptables__all_filter_init }} +{{ iptables__v4_filter_prepend }} {{ iptables__all_filter_prepend }} # Allow all loopback (lo) traffic and reject anything diff --git a/templates/rules.v6 b/templates/rules.v6 index dcff29a..3d3ede0 100644 --- a/templates/rules.v6 +++ b/templates/rules.v6 @@ -29,8 +29,10 @@ COMMIT -F -X -{{ iptables__v6_filter_prepend }} +{{ iptables__v4_filter_init }} +{{ iptables__all_filter_init }} +{{ iptables__v4_filter_prepend }} {{ iptables__all_filter_prepend }} # Allow all loopback (lo) traffic and reject anything