2023-11-20 02:07:08 +01:00
|
|
|
[
|
|
|
|
{
|
|
|
|
"name": "install packages",
|
|
|
|
"become": true,
|
|
|
|
"ansible.builtin.apt": {
|
2024-03-20 00:05:11 +01:00
|
|
|
"update_cache": true,
|
2023-11-20 02:07:08 +01:00
|
|
|
"pkg": [
|
|
|
|
"lighttpd",
|
|
|
|
"lighttpd-mod-openssl"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "activate openssl module | file",
|
|
|
|
"become": true,
|
|
|
|
"ansible.builtin.template": {
|
|
|
|
"src": "10-ssl-custom.conf.j2",
|
|
|
|
"dest": "/etc/lighttpd/conf-available/10-ssl-custom.conf"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "activate openssl module | link",
|
|
|
|
"become": true,
|
|
|
|
"ansible.builtin.file": {
|
|
|
|
"state": "link",
|
|
|
|
"src": "/etc/lighttpd/conf-available/10-ssl-custom.conf",
|
|
|
|
"dest": "/etc/lighttpd/conf-enabled/10-ssl-custom.conf"
|
|
|
|
}
|
|
|
|
},
|
2024-04-20 17:08:39 +02:00
|
|
|
{
|
2024-06-01 17:56:28 +02:00
|
|
|
"name": "ufw | check",
|
2024-04-20 17:08:39 +02:00
|
|
|
"check_mode": true,
|
2024-06-01 17:56:28 +02:00
|
|
|
"become": true,
|
2024-04-20 17:08:39 +02:00
|
|
|
"community.general.ufw": {
|
2024-06-01 17:56:28 +02:00
|
|
|
"state": "enabled"
|
|
|
|
},
|
|
|
|
"register": "ufw_enable_check"
|
2024-04-20 17:08:39 +02:00
|
|
|
},
|
|
|
|
{
|
2024-06-01 17:56:28 +02:00
|
|
|
"name": "ufw | allow port 80",
|
|
|
|
"when": "not ufw_enable_check.changed",
|
|
|
|
"become": true,
|
2024-04-20 17:08:39 +02:00
|
|
|
"community.general.ufw": {
|
|
|
|
"rule": "allow",
|
|
|
|
"port": "80",
|
|
|
|
"proto": "tcp"
|
2024-06-01 17:56:28 +02:00
|
|
|
}
|
2024-04-20 17:08:39 +02:00
|
|
|
},
|
|
|
|
{
|
2024-06-01 17:56:28 +02:00
|
|
|
"name": "ufw | allow port 443",
|
|
|
|
"when": "not ufw_enable_check.changed",
|
|
|
|
"become": true,
|
2024-04-20 17:08:39 +02:00
|
|
|
"community.general.ufw": {
|
|
|
|
"rule": "allow",
|
|
|
|
"port": "443",
|
|
|
|
"proto": "tcp"
|
2024-06-01 17:56:28 +02:00
|
|
|
}
|
2024-04-20 17:08:39 +02:00
|
|
|
},
|
2023-11-20 02:07:08 +01:00
|
|
|
{
|
|
|
|
"name": "restart service",
|
|
|
|
"become": true,
|
|
|
|
"ansible.builtin.systemd_service": {
|
|
|
|
"state": "restarted",
|
|
|
|
"name": "lighttpd"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|