---
- name: Enable ufw
  action: ufw state=enabled

- name: Allow outbound public traffic
  action: ufw direction=out policy=allow
  notify: Reload ufw

- name: Deny other inbound traffic
  action: ufw direction=in policy=deny
  notify: Reload ufw

- name: Allow inbound traffic from internal hosts
  action: ufw direction=in proto=any from_ip={{ item }} rule=allow
  with_items:
    - 10.132.250.45   # dns-01
    - 10.132.248.122  # dns-02
    - 10.132.223.240  # gateway-01
    - 10.132.236.208  # config-02
    - 10.132.224.20   # ci-01
    - 10.132.251.252  # knowhow-01
  notify: Reload ufw

---
- name: Enable ufw
  action: ufw state=enabled

- name: Allow outbound public traffic
  action: ufw direction=outbound policy=allow
  notify: Reload ufw

- name: Allow inbound traffic from internal hosts
  action: ufw direction=in proto=any from_ip={{ item }} rule=allow
  with_items:
    - 10.132.250.45   # dns-01
    - 10.132.248.122  # dns-02
    - 10.132.223.240  # gateway-01
    - 10.132.236.208  # config-02
    - 10.132.224.20   # ci-01
    - 10.132.251.252  # knowhow-01
  notify: Reload ufw

- name: Deny other inbound traffic
  action: ufw direction=in policy=deny
  notify: Reload ufw

Allow inbound private traffic before setting the default policy to deny
Allow inbound private traffic before setting the default policy to deny
