Skip to content

Commit

Permalink
add ability to loop over campus network
Browse files Browse the repository at this point in the history
  • Loading branch information
kayiwa committed Dec 20, 2024
1 parent db67906 commit 1a767d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions playbooks/utils/ufw_firewall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
become: true
vars:
running_on_server: true
vars_files:
- ../../group_vars/all/vars.yml

pre_tasks:
- name: stop playbook if you didn't pass --limit
Expand Down
6 changes: 6 additions & 0 deletions roles/ufw_firewall/vars/main.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit 1a767d7

Please sign in to comment.