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:
29
ansible/roles/firewall/tasks/freebsd.yaml
Normal file
29
ansible/roles/firewall/tasks/freebsd.yaml
Normal 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
|
||||
Reference in New Issue
Block a user