aboutsummaryrefslogtreecommitdiffstats
path: root/roles/pf/tasks
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2020-11-10 20:46:04 +0100
committerbinary <me@rgoncalves.se>2020-11-10 20:46:04 +0100
commit0a673e300800b91342499cec9cd482b5d2d9c603 (patch)
tree752309b2f30928063340afefe39682679491a451 /roles/pf/tasks
parent89c7516b1f9ec4ce7ce2947f98f2070c242f4459 (diff)
downloadinfrastructure-0a673e300800b91342499cec9cd482b5d2d9c603.tar.gz
Fully working init for alpine vm
Diffstat (limited to 'roles/pf/tasks')
-rw-r--r--roles/pf/tasks/main.yml19
1 files changed, 19 insertions, 0 deletions
diff --git a/roles/pf/tasks/main.yml b/roles/pf/tasks/main.yml
index c47a721..51471c5 100644
--- a/roles/pf/tasks/main.yml
+++ b/roles/pf/tasks/main.yml
@@ -11,5 +11,24 @@
group: "{{ group_root }}"
mode: "0600"
+- name: Enable pf
+ shell: /sbin/pfctl -e
+ ignore_errors: true
+
- name: Restart pf
shell: /sbin/pfctl -f /etc/pf.conf
+
+- name: Test ssh connection on new pf rule
+ wait_for:
+ port: 22
+ delay: 2
+ state: started
+
+- name: Add cron job for pf
+ cron:
+ cron_file: /etc/crontab
+ name: "Reload pf configuration"
+ user: root
+ job: "/sbin/pfctl -f /etc/pf.conf > /dev/nul 2>&1"
+ minute: "*"
+
remember that computers suck.