[ { "name": "install packages", "become": true, "ansible.builtin.apt": { "update_cache": true, "pkg": [ "proftpd-core" ] } }, { "name": "check whether enabling UFW would be considered a change", "check_mode": true, "community.general.ufw": { "state": "enabled" }, "register": "ufw_enable_check" }, { "name": "allow FTP port 20 in ufw", "when": "not ufw_enable_check.changed", "community.general.ufw": { "rule": "allow", "port": "20", "proto": "tcp" } }, { "name": "allow FTP port 21 in ufw", "when": "not ufw_enable_check.changed", "community.general.ufw": { "rule": "allow", "port": "21", "proto": "tcp" } } ]