ansible-base/roles/nginx/tasks/main.json

81 lines
1.5 KiB
JSON
Raw Normal View History

2023-11-20 02:07:08 +01:00
[
{
"name": "install packages",
"become": true,
"ansible.builtin.apt": {
2024-03-20 00:05:42 +01:00
"update_cache": true,
2023-11-20 02:07:08 +01:00
"pkg": [
"nginx"
]
}
},
{
2024-06-01 17:56:28 +02:00
"name": "ufw | check",
"become": true,
"check_mode": true,
"community.general.ufw": {
2024-06-01 17:56:28 +02:00
"state": "enabled"
},
"register": "ufw_enable_check"
},
{
2024-06-01 17:56:28 +02:00
"name": "ufw | allow port 80",
"when": "not ufw_enable_check.changed",
"become": true,
"community.general.ufw": {
"rule": "allow",
"port": "80",
"proto": "tcp"
2024-06-01 17:56:28 +02:00
}
},
{
2024-06-01 17:56:28 +02:00
"name": "ufw | allow port 443",
"when": "not ufw_enable_check.changed",
"become": true,
"community.general.ufw": {
"rule": "allow",
"port": "443",
"proto": "tcp"
2024-06-01 17:56:28 +02:00
}
},
2024-06-09 11:00:09 +02:00
{
"name": "auto reload",
"when": "var_nginx_auto_reload_interval == None",
"become": true,
"ansible.builtin.cron": {
"name": "nginx_auto_reload",
"disabled": true,
"minute": "0",
"hour": "*/{{var_nginx_auto_reload_interval | string}}",
"day": "*",
"month": "*",
"weekday": "*",
"job": "systemctl reload nginx"
}
},
2024-06-06 13:51:31 +02:00
{
"name": "auto reload",
"when": "var_nginx_auto_reload_interval != None",
"become": true,
"ansible.builtin.cron": {
"name": "nginx_auto_reload",
"disabled": false,
"minute": "0",
"hour": "*/{{var_nginx_auto_reload_interval | string}}",
"day": "*",
"month": "*",
"weekday": "*",
"job": "systemctl reload nginx"
}
},
2023-11-20 02:07:08 +01:00
{
"name": "restart service",
"become": true,
"ansible.builtin.systemd_service": {
"state": "restarted",
"name": "nginx"
}
}
]