mirror of
https://github.com/FAUSheppy/athq-vm-management
synced 2025-12-06 05:41:35 +01:00
feat: warn if iptables loader is no present/enabled
This commit is contained in:
1
main.py
1
main.py
@@ -39,6 +39,7 @@ if __name__ == "__main__":
|
||||
# dump nginx config #
|
||||
if args.skip_nginx:
|
||||
nginx.dump_config(vmList, MASTER_ADDRESS)
|
||||
nginx.check_transparent_proxy_loader()
|
||||
|
||||
# dump icinga master
|
||||
if args.skip_icinga:
|
||||
|
||||
10
nginx.py
10
nginx.py
@@ -1,5 +1,6 @@
|
||||
import jinja2
|
||||
import json
|
||||
import os
|
||||
|
||||
ACME_CONTENT = '''
|
||||
location /.well-known/acme-challenge/ {
|
||||
@@ -66,3 +67,12 @@ def dump_config(vmList, masterAddress):
|
||||
content = template.render(nginxJson)
|
||||
|
||||
f.write(content)
|
||||
|
||||
def check_transparent_proxy_loader():
|
||||
retcode = os.system("systemctl is-enabled nginx-iptables.service")
|
||||
if retcode != 0:
|
||||
print("############################ WARNING ###############################")
|
||||
print("+++ You may have transparent proxy rules but the service to load +++")
|
||||
print("+++ them is not enabled or missing, a restart WILL break your +++")
|
||||
print("+++ setup! Add see nginx-iptables.service in the project root +++")
|
||||
print("############################ WARNING ###############################")
|
||||
|
||||
Reference in New Issue
Block a user