aboutsummaryrefslogtreecommitdiffstats
path: root/roles/pf/templates
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2020-11-07 20:39:07 +0100
committerbinary <me@rgoncalves.se>2020-11-07 20:39:07 +0100
commit8ff8f1fa4037defebab29c7c7775ae3372cbe9a7 (patch)
treee395508f5a962fc9afce777cff08dbfecb0862d4 /roles/pf/templates
parent352c98322771af117a85904d580e1c062062d634 (diff)
downloadinfrastructure-8ff8f1fa4037defebab29c7c7775ae3372cbe9a7.tar.gz
Automate network deployment
Diffstat (limited to 'roles/pf/templates')
-rw-r--r--roles/pf/templates/pf.conf.j29
1 files changed, 3 insertions, 6 deletions
diff --git a/roles/pf/templates/pf.conf.j2 b/roles/pf/templates/pf.conf.j2
index 64001cf..d39694d 100644
--- a/roles/pf/templates/pf.conf.j2
+++ b/roles/pf/templates/pf.conf.j2
@@ -13,18 +13,15 @@ set skip on { lo tun0 }
block all
-{% for key, value in services.tcp.items() %}
-pass in quick on egress proto tcp to port {{ value }}
-{% endfor %}
-{% for key, value in services.udp.items() %}
-pass in quick on egress proto udp to port {{ value }}
+{% for service in services %}
+pass in quick on egress proto {{ service["proto"] }} to port {{ service["port"] }}
{% endfor %}
# ====================== #
# sub-config. by Ansible
# ====================== #
-{% include "templates/" + inventory_hostname + "/etc/pf.conf.j2" %}
+{% include "templates/" + inventory_hostname + "/etc/pf.conf.j2" ignore missing %}
# ========================= #
# out. interface by Ansible
remember that computers suck.