From a5155ec070ca06ba9b0cbb31868e047c419e54c6 Mon Sep 17 00:00:00 2001 From: Francis Kayiwa Date: Fri, 20 Dec 2024 08:03:41 -0500 Subject: [PATCH] add loops over campus network --- roles/ufw_firewall/vars/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/ufw_firewall/vars/main.yml b/roles/ufw_firewall/vars/main.yml index 00391dd1a9..99bf6f39ed 100644 --- a/roles/ufw_firewall/vars/main.yml +++ b/roles/ufw_firewall/vars/main.yml @@ -1,2 +1,8 @@ --- # vars file for roles/ufw_firewall +ufw_firewall_rules: > + {%- set rules = [] -%} + {%- for network in ufw_campus_and_vpn -%} + {{ rules.append({'protocol': 'tcp', 'source': network, 'port': 22, 'action': 'ACCEPT'}) }} + {%- endfor -%} + {{ rules }}