Create a firewall role that installs a pf.conf on FreeBSD.

Does not yet configure pflog nor does it do anything on Linux.
This commit is contained in:
Tom Alexander
2022-10-12 21:23:40 -04:00
parent f20dd66d88
commit 6bdbbfa2ac
12 changed files with 101 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
- name: Install service configuration
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: root
group: wheel
loop:
- src: rc.conf
dest: /etc/rc.conf.d/pf
- name: Install PF configuration
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: root
group: wheel
validate: "pfctl -vnf %s"
notify: restart pf
loop:
- src: "{{ pf_config }}"
dest: /etc/pf.conf
- name: Check if pf is running
shell: service pf status
register: is_pf_running
failed_when: is_pf_running.rc != 0
ignore_errors: true