sap-linuxlab / community.sap_install

Automation for SAP - Collection of Ansible Roles for various SAP software installation
Apache License 2.0
53 stars 55 forks source link

sap_hana_preconfigure/SLES: sap_hana_preconfigure_update needs validation/wait #791

Closed marcelmamula closed 2 months ago

marcelmamula commented 2 months ago

Issue

Running sap_hana_preconfigurewith sap_hana_preconfigure_updatecan cause significant changes to OS, resulting in longer kernel patch/upgrade process. This will result in failing sap_install_media_detectrole when attempting to execute package module, while kernel is still being worked on.

Post-reboot patching visible in process list:

root      1163   950  0 13:10 ?        00:00:00 /usr/bin/python3 /usr/lib/zypp/plugins/commit/zyppnotify
root       950     1  0 13:10 ?        00:00:00 /usr/bin/zypper -n purge-kernels
root      1067     1  0 13:10 ?        00:00:00 gpg-agent --homedir /var/tmp/zypp.Hik3c0/zypp-trusted-krHyD8o2 --use-standard-socket --daemon

Error during sap_install_media_detect execution, when unzip was supposed to install.

TASK [/mnt/c/scripts/community.sap_install/roles/sap_install_media_detect : SAP Install Media Detect - Prepare - Ensure the presence of the 'unzip' package] ***
fatal: [h01hana0]: FAILED! => {"changed": false, "cmd": ["/usr/bin/zypper", "--quiet", "--non-interactive", "--xmlout", "--disable-repositories", "search", "--type", "package", "--match-exact", "--details", "--installed-only", "unzip"], "msg": "Zypper run command failed with return code 7.", "rc": 7, "stderr": "", "stderr_lines": [], "stdout": "<?xml version='1.0'?>\n<stream>\n<message type=\"error\">System management is locked by the application with pid 950 (/usr/bin/zypper).\nClose this application before trying again.</message>\n</stream>\n", "stdout_lines": ["<?xml version='1.0'?>", "<stream>", "<message type=\"error\">System management is locked by the application with pid 950 (/usr/bin/zypper).", "Close this application before trying again.</message>", "</stream>"]}

Solution proposal

  1. Validation in sap_hana_preconfigure to ensure that package operations are completed, before ending role.
marcelmamula commented 2 months ago

Resolved with https://github.com/sap-linuxlab/community.sap_install/pull/796