From 09ab46fce26aff6b79a873440adcb8463d6457f3 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Fri, 4 Oct 2024 13:28:02 +0200 Subject: [PATCH] nexus: add nexus_force_init parameter (#1657) With the nexus_force_init parameter it is possible to force the initialisation of the service. Signed-off-by: Christian Berendt --- roles/nexus/defaults/main.yml | 6 ++++-- roles/nexus/tasks/main.yml | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/roles/nexus/defaults/main.yml b/roles/nexus/defaults/main.yml index de4eedf4e..6f5c134e3 100644 --- a/roles/nexus/defaults/main.yml +++ b/roles/nexus/defaults/main.yml @@ -32,12 +32,14 @@ nexus_container_name: nexus nexus_old_service_name: "docker-compose@nexus" nexus_service_name: "nexus" -# NOTE: provision scripts that are included in the Nexus container image +nexus_force_init: false + +# provision scripts that are included in the Nexus container image nexus_provision_scripts: - anonymous.json - cleanup.json -# NOTE: provision scripts that are included in this role +# provision scripts that are included in this role nexus_provision_groovy_scripts: - create_repos_from_list - setup_http_proxy diff --git a/roles/nexus/tasks/main.yml b/roles/nexus/tasks/main.yml index b1fcc1956..b9bbb7aab 100644 --- a/roles/nexus/tasks/main.yml +++ b/roles/nexus/tasks/main.yml @@ -10,4 +10,6 @@ - name: Include initialize tasks ansible.builtin.include_tasks: initialize.yml tags: initialize - when: not ansible_local.osism.nexus.status | default("False") | bool + when: + - (not ansible_local.osism.nexus.status | default("False") | bool or + nexus_force_init | bool)