summaryrefslogtreecommitdiff
path: root/roles/firewall/templates/groups.yml.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/firewall/templates/groups.yml.j2')
-rw-r--r--roles/firewall/templates/groups.yml.j242
1 files changed, 42 insertions, 0 deletions
diff --git a/roles/firewall/templates/groups.yml.j2 b/roles/firewall/templates/groups.yml.j2
new file mode 100644
index 0000000..5641e2a
--- /dev/null
+++ b/roles/firewall/templates/groups.yml.j2
@@ -0,0 +1,42 @@
+group:
+{% if firewall_groups.network | default([]) %}
+ network_group:
+{% for g in firewall_groups.network %}
+ - name: {{ g.name | to_json }}
+ afi: ipv4
+{% if g.description is defined %}
+ description: {{ g.description | to_json }}
+{% endif %}
+ members:
+{% for n in g.networks %}
+ - address: {{ n | to_json }}
+{% endfor %}
+{% endfor %}
+{% endif %}
+{% if firewall_groups.address | default([]) %}
+ address_group:
+{% for g in firewall_groups.address %}
+ - name: {{ g.name | to_json }}
+ afi: ipv4
+{% if g.description is defined %}
+ description: {{ g.description | to_json }}
+{% endif %}
+ members:
+{% for a in g.addresses %}
+ - address: {{ a | to_json }}
+{% endfor %}
+{% endfor %}
+{% endif %}
+{% if firewall_groups.port | default([]) %}
+ port_group:
+{% for g in firewall_groups.port %}
+ - name: {{ g.name | to_json }}
+{% if g.description is defined %}
+ description: {{ g.description | to_json }}
+{% endif %}
+ members:
+{% for p in g.ports %}
+ - port: {{ p | string | to_json }}
+{% endfor %}
+{% endfor %}
+{% endif %}