---
- name: Install UFW Firewall
  apt:
    name: ufw
    state: latest

- name: UFW - Disable all other incoming by default
  ufw:
    policy: deny
    direction: incoming

- name: UFW - Allow all other outgoing by default
  ufw:
    policy: allow
    direction: outgoing

- name: UFW - Enable AzuraCast TCP Ports
  ufw:
    rule: allow
    port: "{{ item }}"
    proto: tcp
  with_items:
   - 80
   - 443
   - '8000:8999'

- name: UFW - Enable SSH
  ufw:
    rule: limit
    port: ssh
    proto: tcp

- name: UFW - Turn on Firewall
  ufw:
    state: enabled
