From 540b6621ac0a0509a032cb85adc0931274274ed8 Mon Sep 17 00:00:00 2001 From: Louise Davies Date: Thu, 16 Nov 2023 15:01:33 +0000 Subject: [PATCH] Skip ids.storage_file handler when running initial install - The handler still runs in the role, just stops the handler from running again at the end The handler works normally if it's not been installed in the play --- .../ids_storage_file/handlers/ids_storage_file-handler.yml | 2 +- roles/ids_storage_file/tasks/installation.yml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/roles/ids_storage_file/handlers/ids_storage_file-handler.yml b/roles/ids_storage_file/handlers/ids_storage_file-handler.yml index 3e946e2..d087531 100644 --- a/roles/ids_storage_file/handlers/ids_storage_file-handler.yml +++ b/roles/ids_storage_file/handlers/ids_storage_file-handler.yml @@ -9,4 +9,4 @@ become_user: root args: executable: /bin/bash - when: payaraStatus.rc == 0 + when: payaraStatus.rc == 0 and (not ids_storage_file_installed is defined or ids_storage_file_installed != true) diff --git a/roles/ids_storage_file/tasks/installation.yml b/roles/ids_storage_file/tasks/installation.yml index 0c16944..5a89c34 100644 --- a/roles/ids_storage_file/tasks/installation.yml +++ b/roles/ids_storage_file/tasks/installation.yml @@ -3,6 +3,12 @@ - name: 'Setup ids_storage_file' include_tasks: handlers/ids_storage_file-handler.yml +# needed to fix CI failing because of the payara restart in ids.storage_file setup script +# can remove when the Payara issue is resolved +- name: "Set temporary fact to indicate ids_storage_file was installed in this play (use this to skip the handler from running again later)" + set_fact: + ids_storage_file_installed: true + - name: 'Set fact on host to record that ids_storage_file has been instantiated' ini_file: path: /etc/ansible/facts.d/local.fact