From 61772d591677cfe5d74deec8b0ff2f0aa066d753 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 19 Sep 2025 11:18:29 +0200 Subject: [PATCH] Solved testing mode bug --- cli/deploy.py | 13 ++++++++++--- group_vars/all/01_modes.yml | 2 +- roles/sys-svc-certs/tasks/flavors/_san.yml | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/cli/deploy.py b/cli/deploy.py index d7a26b40..ec78df10 100644 --- a/cli/deploy.py +++ b/cli/deploy.py @@ -17,6 +17,7 @@ def run_ansible_playbook( password_file=None, verbose=0, skip_build=False, + skip_tests=False, logs=False ): start_time = datetime.datetime.now() @@ -56,9 +57,8 @@ def run_ansible_playbook( except subprocess.CalledProcessError: print("\n❌ Inventory validation failed. Deployment aborted.\n", file=sys.stderr) sys.exit(1) - - # Tests are controlled via MODE_TEST - if modes.get("MODE_TEST", False): + + if not skip_tests: print("\n🧪 Running tests (make messy-test)...\n") subprocess.run(["make", "messy-test"], check=True) @@ -255,6 +255,12 @@ def main(): action="store_true", help="Skip running 'make build' before deployment.", ) + parser.add_argument( + "-t", + "--skip-tests", + action="store_true", + help="Skip running 'make messy-tests' before deployment.", + ) parser.add_argument( "-i", "--id", @@ -301,6 +307,7 @@ def main(): password_file=args.password_file, verbose=args.verbose, skip_build=args.skip_build, + skip_tests=args.skip_tests, logs=args.logs, ) diff --git a/group_vars/all/01_modes.yml b/group_vars/all/01_modes.yml index 0a0714b3..e59b26c2 100644 --- a/group_vars/all/01_modes.yml +++ b/group_vars/all/01_modes.yml @@ -1,7 +1,7 @@ # Mode # The following modes can be combined with each other -MODE_TEST: false # Executes test routines instead of productive routines +MODE_DUMMY: false # Executes dummy/test routines instead of productive routines MODE_UPDATE: true # Executes updates MODE_DEBUG: false # This enables debugging in ansible and in the apps, You SHOULD NOT enable this on production servers MODE_RESET: false # Cleans up all Infinito.Nexus files. It's necessary to run to whole playbook and not particial roles when using this function. diff --git a/roles/sys-svc-certs/tasks/flavors/_san.yml b/roles/sys-svc-certs/tasks/flavors/_san.yml index 4d2e1821..89af5db0 100644 --- a/roles/sys-svc-certs/tasks/flavors/_san.yml +++ b/roles/sys-svc-certs/tasks/flavors/_san.yml @@ -18,7 +18,7 @@ {% else %} --letsencrypt-webroot-path "{{ LETSENCRYPT_WEBROOT_PATH }}" {% endif %} - {{ '--mode-test' if MODE_TEST | bool else '' }} + {{ '--mode-test' if MODE_DUMMY | bool else '' }} register: certbundle_result changed_when: > ('certificate not yet due for renewal' not in (certbundle_result.stdout | lower | default('')))