30 lines
618 B
YAML
30 lines
618 B
YAML
- 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
|