Skip to content

Commit

Permalink
Merge pull request #7417 from freedomofpress/stg-iptables-mon
Browse files Browse the repository at this point in the history
Ensure /etc/iptables exists before writing to it
  • Loading branch information
cfm authored Jan 24, 2025
2 parents 034b834 + 8efcabd commit 7674452
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@
admin_net_cidr: "{{ '/'.join([admin_net_info.network, admin_net_info.netmask])|ipaddr('cidr') }}"
delegate_to: localhost

- name: Check iptables-persistent was installed
stat:
path: /etc/iptables/
register: etc_iptables_check

- name: Install iptables-persistent if needed
apt:
name: iptables-persistent
state: present
update_cache: yes
cache_valid_time: 3600
when: not etc_iptables_check.stat.exists

- name: Copy IPv4 iptables rules.
template:
src: rules_v4
Expand Down

0 comments on commit 7674452

Please sign in to comment.