feat: warn if iptables loader is no present/enabled

This commit is contained in:
2023-03-16 22:28:21 +01:00
parent fe8e2ee0ba
commit 1a221258db
2 changed files with 11 additions and 0 deletions

View File

@@ -39,6 +39,7 @@ if __name__ == "__main__":
# dump nginx config # # dump nginx config #
if args.skip_nginx: if args.skip_nginx:
nginx.dump_config(vmList, MASTER_ADDRESS) nginx.dump_config(vmList, MASTER_ADDRESS)
nginx.check_transparent_proxy_loader()
# dump icinga master # dump icinga master
if args.skip_icinga: if args.skip_icinga:

View File

@@ -1,5 +1,6 @@
import jinja2 import jinja2
import json import json
import os
ACME_CONTENT = ''' ACME_CONTENT = '''
location /.well-known/acme-challenge/ { location /.well-known/acme-challenge/ {
@@ -66,3 +67,12 @@ def dump_config(vmList, masterAddress):
content = template.render(nginxJson) content = template.render(nginxJson)
f.write(content) 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 ###############################")