From 0a673e300800b91342499cec9cd482b5d2d9c603 Mon Sep 17 00:00:00 2001 From: binary Date: Tue, 10 Nov 2020 20:46:04 +0100 Subject: Fully working init for alpine vm --- roles/pf/tasks/main.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'roles/pf') 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: "*" + -- cgit v1.2.3