aboutsummaryrefslogtreecommitdiffstats
path: root/roles/pf/tasks/main.yml
blob: 4fafb77d837a8d5660f49238b6130665fcdc4ab5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
- name: generate pf configuration
  template:
    src: pf.conf.j2
    dest: "{{ pf_configuration_file }}"
    owner: 0
    group: 0
    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 }}"

- name: test ssh connection on new pf rule
  wait_for:
    port: 22
    delay: 2
    state: started
remember that computers suck.