From 8cd07e27ca757e26a7093a3f4d9bfa4697d1ad4b Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 2 Jan 2025 11:55:34 +0100 Subject: [PATCH 1/2] sap_swpm: Use master password only when necessary Solves issue #909. Signed-off-by: Bernd Finger --- roles/sap_swpm/tasks/pre_install/generate_inifile.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml index 7a53ba7b..4a72e1f6 100644 --- a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml +++ b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml @@ -110,6 +110,7 @@ sap_swpm_sapadm_password: "{{ sap_swpm_master_password }}" sap_swpm_sap_sidadm_password: "{{ sap_swpm_master_password }}" sap_swpm_diagnostics_agent_password: "{{ sap_swpm_master_password }}" + when: sap_swpm_master_password is defined and sap_swpm_master_password # Generate inifile.params, step 1: Process SWPM Configfile template locally for creating inifile.params - name: SAP SWPM Pre Install, create inifile - Process SWPM inifile template for creating 'inifile.params' From eba616365cc05ef419bd62d1cfc2512b58e1ef98 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 3 Jan 2025 10:54:11 +0100 Subject: [PATCH 2/2] sap_swpm: Support empty individual passwords Signed-off-by: Bernd Finger --- .../tasks/pre_install/generate_inifile.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml index 4a72e1f6..2f419967 100644 --- a/roles/sap_swpm/tasks/pre_install/generate_inifile.yml +++ b/roles/sap_swpm/tasks/pre_install/generate_inifile.yml @@ -105,12 +105,18 @@ sap_swpm_db_schema_password: "{{ sap_swpm_db_schema_java_password }}" when: "'Java' in sap_swpm_product_catalog_id" +# If the individual passwords are set to a non empty string, use those: - name: SAP SWPM Pre Install - Set other user passwords using master password ansible.builtin.set_fact: - sap_swpm_sapadm_password: "{{ sap_swpm_master_password }}" - sap_swpm_sap_sidadm_password: "{{ sap_swpm_master_password }}" - sap_swpm_diagnostics_agent_password: "{{ sap_swpm_master_password }}" - when: sap_swpm_master_password is defined and sap_swpm_master_password + sap_swpm_sapadm_password: "{{ sap_swpm_master_password + if sap_swpm_master_password | d('') and not sap_swpm_sapadm_password | d('') + else sap_swpm_sapadm_password | d('') }}" + sap_swpm_sap_sidadm_password: "{{ sap_swpm_master_password + if sap_swpm_master_password | d('') and not sap_swpm_sap_sidadm_password | d('') + else sap_swpm_sap_sidadm_password | d('') }}" + sap_swpm_diagnostics_agent_password: "{{ sap_swpm_master_password + if sap_swpm_master_password | d('') and not sap_swpm_diagnostics_agent_password | d('') + else sap_swpm_diagnostics_agent_password | d('') }}" # Generate inifile.params, step 1: Process SWPM Configfile template locally for creating inifile.params - name: SAP SWPM Pre Install, create inifile - Process SWPM inifile template for creating 'inifile.params'