ansible-base/roles/proftpd/tasks/main.json
Marius Melzer 65b00c8840 Add ufw role
- Enable ufw and by default deny incoming traffic
- in other roles: if ufw (role) is enabled, then allow necessary ports
2024-04-20 17:08:39 +02:00

38 lines
688 B
JSON

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