Skip to content

Conversation

marcelmamula
Copy link
Contributor

@marcelmamula marcelmamula commented Sep 30, 2025

NOTE

New re-imagined approach using Inventory to solve delegation issues with package installations is available at #1126.

Premise

Current workflow of sap_hana_install does 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 Install and Addhosts along with range of changes:

  • Add new tasks files that need to be delegated to addhosts, because Ansible does not allow loop and delegate_to in same task.
    • NOTE: delegate_to also cannot be on same level as include_tasks so it is set inside of actual task file. It can be inside of block.
  • Add missing tasks:
    • Create user sapadm on addhosts, because it is required when hdblcm is running in addhosts mode as it cannot use root SSH.
  • Add missing validations for addhosts string for quality and contents
  • Renamed most of the tasks to keep same naming structure to divide Pre-Tasks, Post-Tasks, Install and Addhosts.
  • Remove unused task files

Tests

This was tested on SLES 15 SP6 on AWS with AP4S sap_hana_scaleout scenario tuning inputs to test:
NOTE: Variables in table below were shortened to fit GitHub window size.

new_system fact_is_installed addhosts Result
true false undefined SUCCESS
true false defined SUCCESS
true true undefined SUCCESS (Post-Tasks)
true true defined SUCCESS (Post-Tasks with information that addhosts were skipped)
false false undefined FAIL (missing sap_hana_install_addhosts
false false defined FAIL (must be installed)
false true undefined FAIL (missing sap_hana_install_addhosts
false true defined SUCCESS

Implemented 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];
Loading

@marcelmamula marcelmamula self-assigned this Sep 30, 2025
@marcelmamula marcelmamula added the enhancement New feature or request label Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant