Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sap_ha_install_hana_hsr: fixed home directory sourcing #988

Open
nmnet-iamneilsm opened this issue Feb 27, 2025 · 0 comments
Open

sap_ha_install_hana_hsr: fixed home directory sourcing #988

nmnet-iamneilsm opened this issue Feb 27, 2025 · 0 comments

Comments

@nmnet-iamneilsm
Copy link

nmnet-iamneilsm commented Feb 27, 2025

In tasks/configure_hsr.yml, shell sources .sapenv.sh from a fixed home directory setting. The home directory can sometimes (as in my customer's case) deviate based on preference. Would it be an idea to create a variable for this?

- name: "SAP HSR - Check System Replication Status"
  ansible.builtin.shell: |
    source /**usr/sap/{{ sap_ha_install_hana_hsr_sid }}/home/.sapenv.sh** && \
    /usr/sap/{{ sap_ha_install_hana_hsr_sid | upper }}/HDB{{ sap_ha_install_hana_hsr_instance_number }}/exe/hdbnsutil \
    -sr_state
  become: true
  become_user: "{{ sap_ha_install_hana_hsr_sid | lower }}adm"
  register: __sap_ha_install_hana_hsr_srstate
  changed_when: false
  failed_when: false

Same for tasks/run_backup.yml:

- name: "SAP HSR - Verify backup files"
  ansible.builtin.shell: |
    source **/usr/sap/{{ sap_ha_install_hana_hsr_sid }}/home/.sapenv.sh** && \
    find /usr/sap/{{ sap_ha_install_hana_hsr_sid }}/HDB{{ sap_ha_install_hana_hsr_instance_number }}/backup/data/ \
    -type f -name data_bck* \
    -exec /usr/sap/{{ sap_ha_install_hana_hsr_sid }}/SYS/exe/hdb/hdbbackupcheck {} \;
  register: __sap_ha_install_hana_hsr_verify_backup
  failed_when:
    - __sap_ha_install_hana_hsr_verify_backup.rc == '1' or __sap_ha_install_hana_hsr_verify_backup.stderr != ""
  changed_when: false

Creating a symbolic link as a workaround seems to avoid this behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant