aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-21 17:36:10 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-21 17:49:50 +0000
commitdea389b8e65f0222e8f618c15530a0d0172c728e (patch)
tree50c7c503253c8d2d3a8486e04a1f72ef6d56f77a /roles
parent342a810ac8058117c867c583d15935c50e6255f3 (diff)
downloadrules-dea389b8e65f0222e8f618c15530a0d0172c728e.tar.gz
roles/pf: Pass ansible-lint
Diffstat (limited to 'roles')
-rw-r--r--roles/pf/handlers/main.yml10
-rw-r--r--roles/pf/tasks/main.yml12
2 files changed, 12 insertions, 10 deletions
diff --git a/roles/pf/handlers/main.yml b/roles/pf/handlers/main.yml
index 187e769..5d75a1a 100644
--- a/roles/pf/handlers/main.yml
+++ b/roles/pf/handlers/main.yml
@@ -1,2 +1,12 @@
- name: lint pf configuration
command: "pfctl -nf {{ pf_configuration_file }}"
+
+- name: enable pf
+ command: pfctl -e
+ register: result
+ failed_when:
+ - result.rc != 0
+ - "'already enabled' not in result.stderr"
+
+- name: restart pf
+ command: pfctl -f "{{ pf_configuration_file }}"
diff --git a/roles/pf/tasks/main.yml b/roles/pf/tasks/main.yml
index 4fafb77..3924a89 100644
--- a/roles/pf/tasks/main.yml
+++ b/roles/pf/tasks/main.yml
@@ -7,16 +7,8 @@
mode: 0600
notify:
- lint pf configuration
-
-- name: enable pf
- command: pfctl -e
- register: result
- failed_when:
- - result.rc != 0
- - "'already enabled' not in result.stderr"
-
-- name: restart pf
- command: pfctl -f "{{ pf_configuration_file }}"
+ - enable pf
+ - restart pf
- name: test ssh connection on new pf rule
wait_for:
remember that computers suck.