[fix] roles with ufw incocation
This commit is contained in:
parent
abdd13264f
commit
8c7b10f852
|
|
@ -28,30 +28,30 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Check wether enabling UFW would be considered a changed",
|
"name": "check whether enabling UFW would be considered a change",
|
||||||
"check_mode": true,
|
"check_mode": true,
|
||||||
"community.general.ufw": {
|
"community.general.ufw": {
|
||||||
"state": "enabled",
|
"state": "enabled"
|
||||||
|
},
|
||||||
"register": "ufw_enable_check"
|
"register": "ufw_enable_check"
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Allow port 80 in ufw",
|
"name": "allow port 80 in ufw",
|
||||||
|
"when": "not ufw_enable_check.changed",
|
||||||
"community.general.ufw": {
|
"community.general.ufw": {
|
||||||
"rule": "allow",
|
"rule": "allow",
|
||||||
"port": "80",
|
"port": "80",
|
||||||
"proto": "tcp"
|
"proto": "tcp"
|
||||||
},
|
}
|
||||||
"when": "not ufw_enable_check.changed"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Allow port 443 in ufw",
|
"name": "allow port 443 in ufw",
|
||||||
|
"when": "not ufw_enable_check.changed",
|
||||||
"community.general.ufw": {
|
"community.general.ufw": {
|
||||||
"rule": "allow",
|
"rule": "allow",
|
||||||
"port": "443",
|
"port": "443",
|
||||||
"proto": "tcp"
|
"proto": "tcp"
|
||||||
},
|
}
|
||||||
"when": "not ufw_enable_check.changed"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "restart service",
|
"name": "restart service",
|
||||||
|
|
|
||||||
|
|
@ -26,21 +26,21 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Check wether enabling UFW would be considered a changed",
|
"name": "check whether enabling UFW would be considered a change",
|
||||||
"check_mode": true,
|
"check_mode": true,
|
||||||
"community.general.ufw": {
|
"community.general.ufw": {
|
||||||
"state": "enabled",
|
"state": "enabled"
|
||||||
|
},
|
||||||
"register": "ufw_enable_check"
|
"register": "ufw_enable_check"
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Allow port in ufw",
|
"name": "allow port in ufw",
|
||||||
|
"when": "not ufw_enable_check.changed",
|
||||||
"community.general.ufw": {
|
"community.general.ufw": {
|
||||||
"rule": "allow",
|
"rule": "allow",
|
||||||
"port": "{{ var_murmur_port }}",
|
"port": "{{var_murmur_port | string}}",
|
||||||
"proto": "tcp"
|
"proto": "tcp"
|
||||||
},
|
}
|
||||||
"when": "not ufw_enable_check.changed"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "service",
|
"name": "service",
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
|
"var_nginx_auto_reload_interval": null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,9 @@
|
||||||
{
|
{
|
||||||
"name": "generate dhparams file",
|
"name": "generate dhparams file",
|
||||||
"become": true,
|
"become": true,
|
||||||
"ansible.builtin.command": "openssl dhparam -out /etc/nginx/dhparam 4096",
|
"ansible.builtin.command": {
|
||||||
|
"cmd": "openssl dhparam -out /etc/nginx/dhparam 4096"
|
||||||
|
},
|
||||||
"args": {
|
"args": {
|
||||||
"creates": "/etc/nginx/dhparam"
|
"creates": "/etc/nginx/dhparam"
|
||||||
}
|
}
|
||||||
|
|
@ -27,11 +29,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Check wether enabling UFW would be considered a changed",
|
"name": "check whether enabling UFW would be considered a change",
|
||||||
"become": true,
|
"become": true,
|
||||||
"check_mode": true,
|
"check_mode": true,
|
||||||
"community.general.ufw": {
|
"community.general.ufw": {
|
||||||
"state": "enabled",
|
"state": "enabled"
|
||||||
},
|
},
|
||||||
"register": "ufw_enable_check"
|
"register": "ufw_enable_check"
|
||||||
},
|
},
|
||||||
|
|
@ -55,6 +57,21 @@
|
||||||
"proto": "tcp"
|
"proto": "tcp"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "auto reload",
|
||||||
|
"when": "auto_reload_interval != None",
|
||||||
|
"become": true,
|
||||||
|
"ansible.builtin.cron": {
|
||||||
|
"name": "nginx_auto_reload",
|
||||||
|
"disabled": true,
|
||||||
|
"minute": "0",
|
||||||
|
"hour": "*/{{auto_reload_interval | string}}",
|
||||||
|
"day": "*",
|
||||||
|
"month": "*",
|
||||||
|
"weekday": "*",
|
||||||
|
"job": "systemctl reload nginx"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "restart service",
|
"name": "restart service",
|
||||||
"become": true,
|
"become": true,
|
||||||
|
|
|
||||||
8
roles/nginx/vardef.json
Normal file
8
roles/nginx/vardef.json
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"auto_reload_interval": {
|
||||||
|
"description": "in hours",
|
||||||
|
"nullable": true,
|
||||||
|
"type": "integer",
|
||||||
|
"mandatory": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -10,29 +10,29 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Check wether enabling UFW would be considered a changed",
|
"name": "check whether enabling UFW would be considered a change",
|
||||||
"check_mode": true,
|
"check_mode": true,
|
||||||
"community.general.ufw": {
|
"community.general.ufw": {
|
||||||
"state": "enabled",
|
"state": "enabled"
|
||||||
|
},
|
||||||
"register": "ufw_enable_check"
|
"register": "ufw_enable_check"
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Allow FTP port 20 in ufw",
|
"name": "allow FTP port 20 in ufw",
|
||||||
|
"when": "not ufw_enable_check.changed",
|
||||||
"community.general.ufw": {
|
"community.general.ufw": {
|
||||||
"rule": "allow",
|
"rule": "allow",
|
||||||
"port": "20",
|
"port": "20",
|
||||||
"proto": "tcp"
|
"proto": "tcp"
|
||||||
},
|
}
|
||||||
"when": "not ufw_enable_check.changed"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Allow FTP port 21 in ufw",
|
"name": "allow FTP port 21 in ufw",
|
||||||
|
"when": "not ufw_enable_check.changed",
|
||||||
"community.general.ufw": {
|
"community.general.ufw": {
|
||||||
"rule": "allow",
|
"rule": "allow",
|
||||||
"port": "21",
|
"port": "21",
|
||||||
"proto": "tcp"
|
"proto": "tcp"
|
||||||
},
|
}
|
||||||
"when": "not ufw_enable_check.changed"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -59,21 +59,21 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Check wether enabling UFW would be considered a changed",
|
"name": "check whether enabling UFW would be considered a change",
|
||||||
"check_mode": true,
|
"check_mode": true,
|
||||||
"community.general.ufw": {
|
"community.general.ufw": {
|
||||||
"state": "enabled",
|
"state": "enabled"
|
||||||
|
},
|
||||||
"register": "ufw_enable_check"
|
"register": "ufw_enable_check"
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Allow matrix federation port in ufw",
|
"name": "allow matrix federation port in ufw",
|
||||||
|
"when": "not ufw_enable_check.changed",
|
||||||
"community.general.ufw": {
|
"community.general.ufw": {
|
||||||
"rule": "allow",
|
"rule": "allow",
|
||||||
"port": "8448",
|
"port": "8448",
|
||||||
"proto": "tcp"
|
"proto": "tcp"
|
||||||
},
|
}
|
||||||
"when": "not ufw_enable_check.changed"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "restart service",
|
"name": "restart service",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue