--- - name: Remove PAS node from list set_fact: all_instances_hostnames: "{{ all_instances_hostnames | reject('search', ansible_hostname) }}" - name: Create string for PAS config - Get node names set_fact: node_names: "{{ all_instances_hostnames | map(attribute='hostname') | list | flatten | flatten }}" - name: Create string for PAS config - Add hosts and port set_fact: hdbuserstore_string: "{{ hdbuserstore_string | default('') }}{{ item }}.{{ sap_domain }}:30013;" loop: "{{ node_names }}" - name: Create string for PAS config - Remove trailing ';' set_fact: hdbuserstore_string: "{{ hdbuserstore_string[:-1] }}" - name: Save string to compare config set_fact: safe_hdbuserstore_string: "{{ hdbuserstore_string }}" - name: Create string for PAS config - Add HANA SID set_fact: hdbuserstore_string: "{{ hdbuserstore_string }}@{{ GLOBAL_PAS_SID }}" - name: Create string for PAS config set_fact: hdbuserstore_command: 'hdbuserstore SET DEFAULT "{{ hdbuserstore_string }}" SAPHANADB {{ GLOBAL_MASTER_PASSWORD }}' - name: Configure hdbuserstore for failover between the two HANA nodes shell: | source {{ pas_sapenv_custom_path }}; source {{ pas_dbenv_custom_path }}; {{ hdbuserstore_command }} become: true become_user: "{{ sidadm_name }}" - name: Check state of configuration shell: | source {{ pas_sapenv_custom_path }}; source {{ pas_dbenv_custom_path }}; hdbuserstore List become: true become_user: "{{ sidadm_name }}" register: output - name: Fail if configuration was not successful fail: msg: "Unable to configure" when: not safe_hdbuserstore_string in output.stdout