sap_hana_install: Enhance with delegated tasks to achieve proper idempotency for addhosts #1122
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE
New re-imagined approach using Inventory to solve delegation issues with package installations is available at #1126.
Premise
Current workflow of
sap_hana_installdoes not execute any tasks on addhosts, be it for new or existing systems, resulting in inconsistent system. All tasks are executed only on managed node, including important configuration tasks like firewall, selinux, etc.Changes
This PR introduces split of role workflow into separate runner files for
InstallandAddhostsalong with range of changes:loopanddelegate_toin same task.delegate_toalso cannot be on same level asinclude_tasksso it is set inside of actual task file. It can be inside of block.sapadmon addhosts, because it is required whenhdblcmis running inaddhostsmode as it cannot use root SSH.Tests
This was tested on SLES 15 SP6 on AWS with AP4S
sap_hana_scaleoutscenario tuning inputs to test:NOTE: Variables in table below were shortened to fit GitHub window size.
sap_hana_install_addhostssap_hana_install_addhostsImplemented workflow diagram
graph TD; A[Validation and checks] --> B{sap_hana_install_new_system}; B -- true --> C{__sap_hana_install_fact_is_installed}; C -- true --> D[Execute only Post-Tasks]; C -- false --> E[Execute all tasks]; D --> F{sap_hana_install_addhosts}; F -- Defined --> G[Inform about sap_hana_install_new_system false]; B -- false --> I{__sap_hana_install_fact_is_installed}; I -- true --> J{__sap_hana_install_fact_addhosts_hosts_new length > 0}; I -- false --> K[Fail]; J -- true --> L[Execute all tasks]; J -- false --> M[Execute only Post-Tasks];