---
- name: Ensure UFW is installed
  apt:
    name: ufw
    state: present

- name: Set default policy to deny
  community.general.ufw:
    default: 'deny'

- name: Allow SSH connections
  community.general.ufw:
    port: 2222
    rule: 'allow'

- name: Ensure UFW is enabled
  community.general.ufw:
    state: 'enabled'
