From c5a01c837e8095b49843357e681dd14fe64dcca9 Mon Sep 17 00:00:00 2001 From: Niels Abspoel Date: Sat, 3 Sep 2016 21:43:40 +0200 Subject: [PATCH] add ipset support for firewalld --- VERSION | 2 +- firewalld/defaults.yaml | 1 + firewalld/files/ipset.xml | 31 ++++++++++++++++ firewalld/files/zone.xml | 3 ++ firewalld/init.sls | 1 + firewalld/ipsets.sls | 48 +++++++++++++++++++++++++ pillar.example.sls | 74 +++++++++++++++++++++++++++++++++++---- 7 files changed, 152 insertions(+), 8 deletions(-) create mode 100644 firewalld/files/ipset.xml create mode 100644 firewalld/ipsets.sls diff --git a/VERSION b/VERSION index 6e8bf73..0ea3a94 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 +0.2.0 diff --git a/firewalld/defaults.yaml b/firewalld/defaults.yaml index ac2f830..84b32a6 100644 --- a/firewalld/defaults.yaml +++ b/firewalld/defaults.yaml @@ -2,5 +2,6 @@ # vim: ft=yaml firewalld: package: firewalld + ipsetpackage: ipset service: firewalld config: /etc/firewalld.conf diff --git a/firewalld/files/ipset.xml b/firewalld/files/ipset.xml new file mode 100644 index 0000000..204cce7 --- /dev/null +++ b/firewalld/files/ipset.xml @@ -0,0 +1,31 @@ + + +{%- if 'short' in ipset %} + {{ ipset.short }} +{%- endif %} +{%- if 'description' in ipset %} + {{ ipset.description }} +{%- endif %} +{%- if 'options' in ipset %} +{%- if 'maxelem' in ipset.options %} +{%- for v in ipset.options.maxelem %} +