- name: Install UFW ansible.builtin.apt: name: ufw state: latest update_cache: yes - name: Allow SSH community.general.ufw: rule: allow name: OpenSSH - name: Enable Firewall community.general.ufw: state: enabled