From 73f331291bde0da4082e8ac4481de71ca7df4e5f Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Sun, 30 Oct 2022 16:26:36 +0000 Subject: [PATCH] pf: ansible-lint fixes --- roles/pf/handlers/main.yml | 9 ++++++--- roles/pf/tasks/main.yml | 13 ++++++------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/roles/pf/handlers/main.yml b/roles/pf/handlers/main.yml index 8cb3d40..2cbe98a 100644 --- a/roles/pf/handlers/main.yml +++ b/roles/pf/handlers/main.yml @@ -1,4 +1,7 @@ --- - -- name: reload pf - command: /sbin/pfctl -f /etc/pf.conf +- name: Reload pf + command: + argv: + - /sbin/pfctl + - -f + - /etc/pf.conf diff --git a/roles/pf/tasks/main.yml b/roles/pf/tasks/main.yml index d5e8d7d..578a0d6 100644 --- a/roles/pf/tasks/main.yml +++ b/roles/pf/tasks/main.yml @@ -1,23 +1,22 @@ --- - -- name: copy pf.conf - copy: +- name: Copy pf.conf + ansible.builtin.copy: src: "{{ firewall_src }}" dest: /etc/pf.conf mode: 0600 owner: root group: "{{ ansible_wheel }}" validate: pfctl -N -f %s - notify: reload pf + notify: Reload pf when: firewall_src is defined -- name: create pf.conf from template - template: +- name: Create pf.conf from template + ansible.builtin.template: src: pf.conf.j2 dest: /etc/pf.conf mode: 0600 owner: root group: "{{ ansible_wheel }}" validate: pfctl -N -f %s - notify: reload pf + notify: Reload pf when: firewall_src is not defined