From 1ec2293fff38c93f2b44944e0fba27d4ace07844 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 4 Dec 2025 18:20:12 +0100 Subject: [PATCH 1/7] sap_hana_install: Rework tags Solves issue #1137. Also adds tag sap_hana_install_check_hana_exists. Signed-off-by: Bernd Finger --- roles/sap_hana_install/README.md | 62 +++++++------------ .../sap_hana_install/tasks/hana_addhosts.yml | 5 +- roles/sap_hana_install/tasks/main.yml | 51 +++++++++------ .../sap_hana_install/tasks/post_addhosts.yml | 3 - roles/sap_hana_install/tasks/post_install.yml | 15 ++--- .../tasks/post_tasks/log_mode.yml | 4 -- roles/sap_hana_install/tasks/pre_addhosts.yml | 15 +++-- roles/sap_hana_install/tasks/pre_install.yml | 23 +++++-- .../tasks/pre_tasks/hdblcm_prepare.yml | 14 +---- .../tasks/pre_tasks/prepare_sarfiles.yml | 1 - .../pre_tasks/prepare_software_addhosts.yml | 14 ++++- .../pre_tasks/prepare_software_install.yml | 10 ++- .../tasks/pre_tasks/prepare_variables.yml | 11 +--- 13 files changed, 118 insertions(+), 110 deletions(-) diff --git a/roles/sap_hana_install/README.md b/roles/sap_hana_install/README.md index 121444d3..f6e3ebf0 100644 --- a/roles/sap_hana_install/README.md +++ b/roles/sap_hana_install/README.md @@ -378,58 +378,42 @@ Installs SAP HANA on `host1` and `host2`, while running on host `host0` where ex ### Role Tags With the following tags, the role can be called to perform certain activities only: -- tag `sap_hana_install_check_installation`: Perform an installation check, using `hdbcheck` or - `hdblcm --action=check_installation`. -- tag `sap_hana_install_chown_hana_directories`: Only perform the chown of the SAP HANA directories - `/hana`, `/hana/shared`, `/hana/log`, and `/hana/data`. The main purpose of this tag is to use it - with `--skip-tags`, to skip modifying these directories. This can be useful when using tag - `sap_hana_install_preinstall`. -- tag `sap_hana_install_configure_firewall`: Use this flag to only configure the firewall ports for - SAP HANA. Note: The role variable `sap_hana_install_update_firewall` has to be set to `true` as - well. -- tag `sap_hana_install_extract_sarfiles`: Use this flag with `--skip-tags` to run the SAR file - preparation steps of tag `sap_hana_install_prepare_sarfiles` without extracting the SAR files. -- tag `sap_hana_install_generate_input_file`: Only generate the input file for SAP Application - deployment - tag `sap_hana_install_hdblcm_commandline`: Only show the hdblcm command line, without processing the hdblcm template. This can be useful for checking the hdblcm command line options, especially when using the `addhosts` function. -- tag `sap_hana_install_preinstall`: Only perform pre-install activities. This includes selecting - the SAPCAR EXE file, extracting the SAR files if necessary, searching for hdblcm, and creating - the hdblcm configfile. -- tag `sap_hana_install_prepare_sapcar`: Only copy the SAPCAR EXE files for the current architecture - to the extraction directory, verify the checksums of these files, and select the latest - version. Or copy the SAPCAR EXE file if given by role variable `sap_hana_install_sapcar_filename` - and then verify the checksum. -- tag `sap_hana_install_prepare_sarfiles`: Run the steps of tag `sap_hana_install_prepare_sapcar` - to select the correct SAPCAR file, then copy the selected or provided SAR files to the - extraction directory (if requested), then verify the checksums of each SAR file. Lastly, extract - these SAR files to the extraction directory. -- tag `sap_hana_install_set_log_mode`: Only set the log mode of an existing HANA installation to - `overwrite`. -- tag `sap_hana_install_store_connection_information`: Only run the `hdbuserstore` command +- tag `sap_hana_install_create_configfile`: Only generate the hdblcm configfile. +- tag `sap_hana_install_check_hana_exists`: Only check if there is already HANA installed with the + desired SID and instance number. +- tag `sap_hana_install_check_installation`: Only perform a SAP HANA installation check + +The following tags have been removed in this release: +- tag `sap_hana_install_preinstall` +- tag `sap_hana_install_chown_hana_directories` +- tag `sap_hana_install_prepare_sapcar` +- tag `sap_hana_install_prepare_sarfiles` +- tag `sap_hana_install_extract_sarfiles` +- tag `sap_hana_install_configure_firewall` +- tag `sap_hana_install_configure_fapolicyd` +- tag `sap_hana_install_generate_input_file` +- tag `sap_hana_install_store_connection_information` +- tag `sap_hana_install_set_log_mode`
How to run sap_hana_install with tags - #### Process SAPCAR and SAR files and create the hdblcm configfile: - ```console - ansible-playbook sap-hana-install.yml --tags=sap_hana_install_preinstall --skip-tags=sap_hana_install_chown_hana_directories + #### Display SAP HANA hdblcm command line without performing an installation: ``` - - #### Process only SAPCAR files: - ```console - ansible-playbook sap-hana-install.yml --tags=sap_hana_install_prepare_sapcar + ansible-playbook sap-hana-install.yml --tags=sap_hana_install_hdblcm_commandline ``` - #### Process SAPCAR and SAR files without extracting SAR files: + #### Only create the hdblcm configfile: ```console - ansible-playbook sap-hana-install.yml --tags=sap_hana_install_prepare_sarfiles --skip-tags=sap_hana_install_extract_sarfiles + ansible-playbook sap-hana-install.yml --tags=sap_hana_install_create_configfile ``` - #### Display SAP HANA hdblcm command without using it - ``` - ansible-playbook sap-hana-install.yml --tags=sap_hana_install_hdblcm_commandline + #### Perform a SAP HANA existence check: + ```console + ansible-playbook sap-hana-install.yml --tags=sap_hana_install_check_hana_exists ```
diff --git a/roles/sap_hana_install/tasks/hana_addhosts.yml b/roles/sap_hana_install/tasks/hana_addhosts.yml index 5543c1be..dd81e20d 100644 --- a/roles/sap_hana_install/tasks/hana_addhosts.yml +++ b/roles/sap_hana_install/tasks/hana_addhosts.yml @@ -9,14 +9,15 @@ ansible.builtin.set_fact: __sap_hana_install_fact_addhosts: "{{ __sap_hana_install_fact_addhosts | d([]) + [item] }}" loop: "{{ sap_hana_install_addhosts.split(',') | map('trim') | reject('equalto', '') | list }}" - when: - - item.split(':')[0] in __sap_hana_install_fact_addhosts_hosts_new + when: item.split(':')[0] in __sap_hana_install_fact_addhosts_hosts_new + tags: sap_hana_install_create_configfile - name: SAP HANA - Addhosts - Update configfile with new addhosts string ansible.builtin.lineinfile: path: "{{ __sap_hana_install_register_tmpdir.path }}/configfile.cfg" regexp: '^addhosts\s*=\s*.*$' line: "addhosts = {{ __sap_hana_install_fact_addhosts | join(',') }}" + tags: sap_hana_install_create_configfile - name: SAP HANA - Addhosts - Set fact for hdblcm command line diff --git a/roles/sap_hana_install/tasks/main.yml b/roles/sap_hana_install/tasks/main.yml index 5ed85e70..06cc1c3e 100644 --- a/roles/sap_hana_install/tasks/main.yml +++ b/roles/sap_hana_install/tasks/main.yml @@ -6,27 +6,28 @@ ansible.builtin.include_tasks: file: pre_tasks/prepare_variables.yml tags: + - sap_hana_install_hdblcm_commandline - sap_hana_install_check_hana_exists - sap_hana_install_check_installation - - sap_hana_install_preinstall - - sap_hana_install_set_log_mode - - sap_hana_install_configure_firewall # SAP HANA presence has to be validated for both new system and adding new hosts. - name: SAP HANA - Main - Validate presence of existing SAP HANA database ansible.builtin.include_tasks: file: pre_tasks/hana_exists.yml + apply: + tags: sap_hana_install_check_hana_exists when: - (sap_hana_install_new_system and not sap_hana_install_force) or not sap_hana_install_new_system tags: + - sap_hana_install_hdblcm_commandline - sap_hana_install_check_hana_exists - - sap_hana_install_preinstall - name: SAP HANA - Main - Identify hosts in play based on addhosts ansible.builtin.include_tasks: file: pre_tasks/identify_hosts.yml + tags: sap_hana_install_hdblcm_commandline - name: SAP HANA - Main - Ensure SAP HANA is running for existing systems or addhosts operations @@ -42,45 +43,59 @@ # - Configuration - Run always to ensure idempotent outcome. - name: Block for Installation tasks - when: - - sap_hana_install_new_system + when: sap_hana_install_new_system +# sap_hana_install_new_system or +# ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) or +# ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) block: - name: SAP HANA - Install - Pre-Tasks ansible.builtin.include_tasks: file: pre_install.yml + tags: + - sap_hana_install_create_configfile + - sap_hana_install_hdblcm_commandline + - sap_hana_install_check_installation - name: SAP HANA - Install ansible.builtin.include_tasks: file: hana_install.yml - when: - - not __sap_hana_install_fact_is_installed - - __sap_hana_install_fact_is_main_host + when: > + (not __sap_hana_install_fact_is_installed and __sap_hana_install_fact_is_main_host) or + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) + tags: sap_hana_install_hdblcm_commandline - name: SAP HANA - Install - Post-tasks ansible.builtin.include_tasks: file: post_install.yml + tags: sap_hana_install_check_installation - name: Block for Addhosts tasks - when: - - not sap_hana_install_new_system - - __sap_hana_install_fact_is_scaleout - - __sap_hana_install_fact_is_installed + when: > + not sap_hana_install_new_system and + ((__sap_hana_install_fact_is_scaleout and __sap_hana_install_fact_is_installed) or + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) or + ('sap_hana_install_create_configfile' in ansible_run_tags|d([]))) block: # Execute only if new hosts are to be added. - name: SAP HANA - Addhosts - Pre-Tasks ansible.builtin.include_tasks: file: pre_addhosts.yml - when: - - __sap_hana_install_fact_addhosts_hosts_new | d([]) | length > 0 - tags: sap_hana_install_preinstall + when: > + (__sap_hana_install_fact_addhosts_hosts_new | d([]) | length > 0) or + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) or + ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) + tags: + - sap_hana_install_hdblcm_commandline + - sap_hana_install_create_configfile - name: SAP HANA - Addhosts ansible.builtin.include_tasks: file: hana_addhosts.yml when: - - __sap_hana_install_fact_addhosts_hosts_new | d([]) | length > 0 - - __sap_hana_install_fact_is_main_host + (__sap_hana_install_fact_addhosts_hosts_new | d([]) | length > 0 and __sap_hana_install_fact_is_main_host) or + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) + tags: sap_hana_install_hdblcm_commandline - name: SAP HANA - Addhosts - Post-tasks ansible.builtin.include_tasks: diff --git a/roles/sap_hana_install/tasks/post_addhosts.yml b/roles/sap_hana_install/tasks/post_addhosts.yml index 1da3b61b..80565815 100644 --- a/roles/sap_hana_install/tasks/post_addhosts.yml +++ b/roles/sap_hana_install/tasks/post_addhosts.yml @@ -14,13 +14,11 @@ - name: SAP HANA - Addhosts - Post-Tasks - Update hdbuserstore connection details ansible.builtin.include_tasks: file: post_tasks/hdbuserstore.yml - tags: sap_hana_install_store_connection_information - name: SAP HANA - Addhosts - Post-Tasks - Firewall ansible.builtin.include_tasks: file: post_tasks/firewall.yml when: sap_hana_install_update_firewall - tags: sap_hana_install_configure_firewall - name: SAP HANA - Addhosts - Post-Tasks - SELinux ansible.builtin.include_tasks: @@ -34,4 +32,3 @@ # Ensure fapolicyd is checked only on supported systems. - ansible_os_family == "RedHat" - __sap_hana_install_configure_fapolicyd - tags: sap_hana_install_configure_fapolicyd diff --git a/roles/sap_hana_install/tasks/post_install.yml b/roles/sap_hana_install/tasks/post_install.yml index c7c5764a..55b4111c 100644 --- a/roles/sap_hana_install/tasks/post_install.yml +++ b/roles/sap_hana_install/tasks/post_install.yml @@ -3,15 +3,14 @@ # Installation tasks that can be destructive and should never be executed on existing database. - name: Block with tasks for new HANA Systems - when: - - not __sap_hana_install_fact_is_installed - - __sap_hana_install_fact_is_main_host + when: > + (not __sap_hana_install_fact_is_installed and __sap_hana_install_fact_is_main_host) or + ('sap_hana_install_check_installation' in ansible_run_tags|d([])) block: - name: SAP HANA - Install - Post-Tasks - Set log_mode ansible.builtin.include_tasks: file: post_tasks/log_mode.yml - tags: sap_hana_install_set_log_mode - name: SAP HANA - Install - Post-Tasks - Apply license ansible.builtin.include_tasks: @@ -26,7 +25,9 @@ - name: SAP HANA - Install - Post-Tasks - Perform an hdblcm installation check ansible.builtin.include_tasks: file: post_tasks/check_installation.yml - when: sap_hana_install_check_installation | d(false) + apply: + tags: sap_hana_install_check_installation + when: sap_hana_install_check_installation or ('sap_hana_install_check_installation' in ansible_run_tags|d([])) tags: sap_hana_install_check_installation - name: SAP HANA - Install - Post-Tasks - Generate Input File for SAP Application Deployment @@ -39,7 +40,6 @@ delegate_to: localhost vars: ansible_become: false - tags: sap_hana_install_generate_input_file # Cleanup extracted software - name: SAP HANA - Install - Post-Tasks - Deleting software extract directory '{{ sap_hana_install_software_extract_directory }}' @@ -65,13 +65,11 @@ - name: SAP HANA - Install - Post-Tasks - Update hdbuserstore connection details ansible.builtin.include_tasks: file: post_tasks/hdbuserstore.yml - tags: sap_hana_install_store_connection_information - name: SAP HANA - Install - Post-Tasks - Firewall ansible.builtin.include_tasks: file: post_tasks/firewall.yml when: sap_hana_install_update_firewall - tags: sap_hana_install_configure_firewall - name: SAP HANA - Install - Post-Tasks - SELinux ansible.builtin.include_tasks: @@ -85,4 +83,3 @@ # Ensure fapolicyd is checked only on supported systems. - ansible_os_family == "RedHat" - __sap_hana_install_configure_fapolicyd - tags: sap_hana_install_configure_fapolicyd diff --git a/roles/sap_hana_install/tasks/post_tasks/log_mode.yml b/roles/sap_hana_install/tasks/post_tasks/log_mode.yml index f5fa90b9..c8b8dd98 100644 --- a/roles/sap_hana_install/tasks/post_tasks/log_mode.yml +++ b/roles/sap_hana_install/tasks/post_tasks/log_mode.yml @@ -24,12 +24,10 @@ - sap_hana_install_log_mode | d('') == 'overwrite' changed_when: false register: __sap_hana_install_register_hdbsql_logmode_no_initial_tenant - tags: sap_hana_install_set_log_mode - name: SAP HANA - Post-Tasks - Display the output of hdbsql, no initial tenant ansible.builtin.debug: msg: "{{ __sap_hana_install_register_hdbsql_logmode_no_initial_tenant.stdout_lines }}" - tags: sap_hana_install_set_log_mode when: - not ansible_check_mode - sap_hana_install_create_initial_tenant == 'n' @@ -60,12 +58,10 @@ - sap_hana_install_log_mode | d('') == 'overwrite' changed_when: false register: __sap_hana_install_register_hdbsql_logmode_with_initial_tenant - tags: sap_hana_install_set_log_mode - name: SAP HANA - Post-Tasks - Display the output of hdbsql, with initial tenant ansible.builtin.debug: msg: "{{ __sap_hana_install_register_hdbsql_logmode_with_initial_tenant.stdout_lines }}" - tags: sap_hana_install_set_log_mode when: - not ansible_check_mode - sap_hana_install_create_initial_tenant == 'y' diff --git a/roles/sap_hana_install/tasks/pre_addhosts.yml b/roles/sap_hana_install/tasks/pre_addhosts.yml index 9e90c08b..a07242bd 100644 --- a/roles/sap_hana_install/tasks/pre_addhosts.yml +++ b/roles/sap_hana_install/tasks/pre_addhosts.yml @@ -51,7 +51,6 @@ # Ensure fapolicyd is checked only on supported systems. - ansible_os_family == "RedHat" - __sap_hana_install_fact_is_new_addhost_host - tags: sap_hana_install_configure_fapolicyd - name: SAP HANA - Addhosts - Pre-Tasks - Configure SELinux file contexts for {{ sap_hana_install_root_path }} @@ -65,7 +64,13 @@ - name: SAP HANA - Addhosts - Pre-Tasks - Validate and prepare software directory ansible.builtin.include_tasks: file: pre_tasks/prepare_software_addhosts.yml - when: __sap_hana_install_fact_is_main_host + when: > + __sap_hana_install_fact_is_main_host or + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) or + ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) + tags: + - sap_hana_install_hdblcm_commandline + - sap_hana_install_create_configfile # Proper idempotency needs to check existing version, not just existence. @@ -85,9 +90,11 @@ file: pre_tasks/hana_directory_permissions.yml # Execute only once for Scale-Out to avoid conflicts when updating shared file systems. when: __sap_hana_install_fact_is_main_host - tags: sap_hana_install_chown_hana_directories - name: SAP HANA - Addhosts - Pre-Tasks - Process the hdblcm configfile ansible.builtin.include_tasks: file: pre_tasks/hdblcm_configfile.yml - when: __sap_hana_install_fact_is_main_host + apply: + tags: sap_hana_install_create_configfile + when: __sap_hana_install_fact_is_main_host or ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) + tags: sap_hana_install_create_configfile diff --git a/roles/sap_hana_install/tasks/pre_install.yml b/roles/sap_hana_install/tasks/pre_install.yml index 0772a7aa..4268bccc 100644 --- a/roles/sap_hana_install/tasks/pre_install.yml +++ b/roles/sap_hana_install/tasks/pre_install.yml @@ -8,7 +8,6 @@ # Ensure fapolicyd is checked only on supported systems. - ansible_os_family == "RedHat" - not __sap_hana_install_fact_is_installed - tags: sap_hana_install_configure_fapolicyd - name: SAP HANA - Install - Pre-Tasks - Configure SELinux file contexts for {{ sap_hana_install_root_path }} @@ -23,7 +22,17 @@ - name: SAP HANA - Install - Pre-Tasks - Validate and prepare software directory ansible.builtin.include_tasks: file: pre_tasks/prepare_software_install.yml - when: __sap_hana_install_fact_is_main_host + apply: + tags: sap_hana_install_create_configfile + when: > + __sap_hana_install_fact_is_main_host or + ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) or + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) or + ('sap_hana_install_check_installation' in ansible_run_tags|d([])) + tags: + - sap_hana_install_create_configfile + - sap_hana_install_hdblcm_commandline + - sap_hana_install_check_installation # Proper idempotency needs to check existing version, not just existence. @@ -45,11 +54,13 @@ # Execute only once for Scale-Out to avoid conflicts when updating shared file systems. run_once: "{{ __sap_hana_install_fact_is_scaleout }}" when: not __sap_hana_install_fact_is_installed - tags: sap_hana_install_chown_hana_directories - name: SAP HANA - Install - Pre-Tasks - Process the hdblcm configfile ansible.builtin.include_tasks: file: pre_tasks/hdblcm_configfile.yml - when: - - __sap_hana_install_fact_is_main_host - - not __sap_hana_install_fact_is_installed + apply: + tags: sap_hana_install_create_configfile + when: > + (not __sap_hana_install_fact_is_installed and __sap_hana_install_fact_is_main_host) or + ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) + tags: sap_hana_install_create_configfile diff --git a/roles/sap_hana_install/tasks/pre_tasks/hdblcm_prepare.yml b/roles/sap_hana_install/tasks/pre_tasks/hdblcm_prepare.yml index 969ab309..b99d372b 100644 --- a/roles/sap_hana_install/tasks/pre_tasks/hdblcm_prepare.yml +++ b/roles/sap_hana_install/tasks/pre_tasks/hdblcm_prepare.yml @@ -9,27 +9,18 @@ ansible.builtin.file: path: "{{ sap_hana_install_software_extract_directory }}" state: absent - tags: - - sap_hana_install_prepare_sapcar - - sap_hana_install_prepare_sarfiles - name: SAP HANA - Pre-Tasks - Create directory '{{ sap_hana_install_software_extract_directory }}' ansible.builtin.file: path: "{{ sap_hana_install_software_extract_directory }}" state: directory mode: '0755' - tags: - - sap_hana_install_prepare_sapcar - - sap_hana_install_prepare_sarfiles - name: SAP HANA - Pre-Tasks - Create SAPCAR directory '{{ sap_hana_install_software_extract_directory }}/sapcar' ansible.builtin.file: path: "{{ sap_hana_install_software_extract_directory }}/sapcar" state: directory mode: '0755' - tags: - - sap_hana_install_prepare_sapcar - - sap_hana_install_prepare_sarfiles - name: SAP HANA - Pre-Tasks - Create status file '{{ sap_hana_install_software_extract_directory }}/__EXTRACTION_ONGOING__' ansible.builtin.file: @@ -42,13 +33,10 @@ block: - name: SAP HANA - Pre-Tasks - Prepare SAPCAR ansible.builtin.include_tasks: prepare_sapcar.yml - tags: - - sap_hana_install_prepare_sapcar - - sap_hana_install_prepare_sarfiles - name: SAP HANA - Pre-Tasks - Prepare SAR files ansible.builtin.include_tasks: prepare_sarfiles.yml - tags: sap_hana_install_prepare_sarfiles + rescue: - name: SAP HANA - Pre-Tasks - Remove status file '{{ sap_hana_install_software_extract_directory }}/__EXTRACTION_ONGOING__' ansible.builtin.file: diff --git a/roles/sap_hana_install/tasks/pre_tasks/prepare_sarfiles.yml b/roles/sap_hana_install/tasks/pre_tasks/prepare_sarfiles.yml index b41a3344..b11578ad 100644 --- a/roles/sap_hana_install/tasks/pre_tasks/prepare_sarfiles.yml +++ b/roles/sap_hana_install/tasks/pre_tasks/prepare_sarfiles.yml @@ -108,7 +108,6 @@ when: - __sap_hana_install_fact_sarfiles | length > 0 - not ansible_check_mode - tags: sap_hana_install_extract_sarfiles - name: SAP HANA - Pre-Tasks - Remove temporary SAR file directory '{{ sap_hana_install_software_extract_directory }}/sarfiles' ansible.builtin.file: diff --git a/roles/sap_hana_install/tasks/pre_tasks/prepare_software_addhosts.yml b/roles/sap_hana_install/tasks/pre_tasks/prepare_software_addhosts.yml index cdeb5106..28b0a7f1 100644 --- a/roles/sap_hana_install/tasks/pre_tasks/prepare_software_addhosts.yml +++ b/roles/sap_hana_install/tasks/pre_tasks/prepare_software_addhosts.yml @@ -12,6 +12,7 @@ check_mode: false register: __sap_hana_install_register_stat_extract_directory failed_when: false + tags: sap_hana_install_create_configfile - name: SAP HANA - Addhosts - Pre-Tasks - Fail if '{{ sap_hana_install_software_extract_directory }}' does not exist ansible.builtin.fail: @@ -19,6 +20,7 @@ FAIL: The directory {{ sap_hana_install_software_extract_directory }} does not exist. Path must be defined in the variable 'sap_hana_install_software_extract_directory'. when: not __sap_hana_install_register_stat_extract_directory.stat.exists + tags: sap_hana_install_create_configfile - name: SAP HANA - Addhosts - Pre-Tasks - Find directory 'SAP_HANA_DATABASE' in '{{ sap_hana_install_software_extract_directory }}' ansible.builtin.find: @@ -27,6 +29,7 @@ file_type: directory patterns: 'SAP_HANA_DATABASE' register: __sap_hana_install_register_find_directory_sap_hana_database_addhosts + tags: sap_hana_install_create_configfile - name: SAP HANA - Addhosts - Pre-Tasks - Fail if directory 'SAP_HANA_DATABASE' does not exist in '{{ sap_hana_install_software_extract_directory }}' ansible.builtin.fail: @@ -38,6 +41,7 @@ ansible.builtin.set_fact: __sap_hana_install_fact_hdblcm_path: "{{ __sap_hana_install_register_find_directory_sap_hana_database_addhosts.files[0].path }}" + tags: sap_hana_install_create_configfile # Create temporary directory and hdblcm configuration file. @@ -48,10 +52,18 @@ register: __sap_hana_install_register_tmpdir tags: - sap_hana_install_hdblcm_commandline + - sap_hana_install_create_configfile - sap_hana_install_check_installation - name: SAP HANA - Addhosts - Pre-Tasks - Fill variable __sap_hana_install_register_tmpdir for check mode only ansible.builtin.set_fact: __sap_hana_install_register_tmpdir: path: '/tmp' - when: ansible_check_mode + when: ansible_check_mode or + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) or + ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) or + ('sap_hana_install_check_installation' in ansible_run_tags|d([])) + tags: + - sap_hana_install_hdblcm_commandline + - sap_hana_install_create_configfile + - sap_hana_install_check_installation diff --git a/roles/sap_hana_install/tasks/pre_tasks/prepare_software_install.yml b/roles/sap_hana_install/tasks/pre_tasks/prepare_software_install.yml index 6a92ba6b..198f40c5 100644 --- a/roles/sap_hana_install/tasks/pre_tasks/prepare_software_install.yml +++ b/roles/sap_hana_install/tasks/pre_tasks/prepare_software_install.yml @@ -133,10 +133,18 @@ when: not __sap_hana_install_fact_is_installed tags: - sap_hana_install_hdblcm_commandline + - sap_hana_install_create_configfile - sap_hana_install_check_installation - name: SAP HANA - Install - Pre-Tasks - Fill variable __sap_hana_install_register_tmpdir for check mode only ansible.builtin.set_fact: __sap_hana_install_register_tmpdir: path: '/tmp' - when: ansible_check_mode + when: ansible_check_mode or + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) or + ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) or + ('sap_hana_install_check_installation' in ansible_run_tags|d([])) + tags: + - sap_hana_install_hdblcm_commandline + - sap_hana_install_create_configfile + - sap_hana_install_check_installation diff --git a/roles/sap_hana_install/tasks/pre_tasks/prepare_variables.yml b/roles/sap_hana_install/tasks/pre_tasks/prepare_variables.yml index 27487e81..d60f0572 100644 --- a/roles/sap_hana_install/tasks/pre_tasks/prepare_variables.yml +++ b/roles/sap_hana_install/tasks/pre_tasks/prepare_variables.yml @@ -19,12 +19,7 @@ else sap_hana_install_number }}" sap_hana_install_system_usage: "{{ sap_hana_install_env_type | d(sap_hana_install_system_usage) | d('custom') }}" sap_hana_install_restrict_max_mem: "{{ sap_hana_install_mem_restrict | d(sap_hana_install_restrict_max_mem) | d('n') }}" - tags: - - sap_hana_install_check_hana_exists - - sap_hana_install_check_installation - - sap_hana_install_preinstall - - sap_hana_install_set_log_mode - - sap_hana_install_configure_firewall + tags: sap_hana_install_check_hana_exists # SID - name: SAP HANA - Pre-Tasks - Assert that the variable 'sap_hana_install_sid' is defined as String consisting of 3 characters @@ -80,11 +75,9 @@ else sap_hana_install_master_password }}" no_log: true # Required for password handling tags: + - sap_hana_install_hdblcm_commandline - sap_hana_install_check_hana_exists - sap_hana_install_check_installation - - sap_hana_install_preinstall - - sap_hana_install_set_log_mode - - sap_hana_install_configure_firewall - name: SAP HANA - Pre-Tasks - Assert that the variable 'sap_hana_install_master_password' is defined as String and not empty ansible.builtin.assert: From d230b1d33b03fd168e2c3d49ae6d8cc5d77bbe19 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 5 Dec 2025 19:57:08 +0100 Subject: [PATCH 2/7] sap_hana_install: Further improvements on tags Relates to #1137 Signed-off-by: Bernd Finger --- roles/sap_hana_install/README.md | 2 ++ roles/sap_hana_install/tasks/hana_install.yml | 4 ++++ roles/sap_hana_install/tasks/main.yml | 14 +++++++++++++- .../tasks/pre_tasks/prepare_variables.yml | 4 +++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/roles/sap_hana_install/README.md b/roles/sap_hana_install/README.md index f6e3ebf0..feef3f49 100644 --- a/roles/sap_hana_install/README.md +++ b/roles/sap_hana_install/README.md @@ -377,6 +377,8 @@ Installs SAP HANA on `host1` and `host2`, while running on host `host0` where ex ### Role Tags +Note: This role can only be used with one tag at a time. + With the following tags, the role can be called to perform certain activities only: - tag `sap_hana_install_hdblcm_commandline`: Only show the hdblcm command line, without processing the hdblcm template. This can be useful for checking the hdblcm command line options, especially diff --git a/roles/sap_hana_install/tasks/hana_install.yml b/roles/sap_hana_install/tasks/hana_install.yml index a3ee2e9e..71120e42 100644 --- a/roles/sap_hana_install/tasks/hana_install.yml +++ b/roles/sap_hana_install/tasks/hana_install.yml @@ -65,6 +65,10 @@ register: __sap_hana_install_register_sapinst failed_when: __sap_hana_install_register_sapinst.finished != 1 or __sap_hana_install_register_sapinst.rc != 0 +- name: SAP HANA - Install - Set SAP HANA is_installed flag + ansible.builtin.set_fact: + __sap_hana_install_fact_is_installed: true + - name: SAP HANA - Install - Display the hdblcm output ansible.builtin.debug: msg: | diff --git a/roles/sap_hana_install/tasks/main.yml b/roles/sap_hana_install/tasks/main.yml index 06cc1c3e..c4af4045 100644 --- a/roles/sap_hana_install/tasks/main.yml +++ b/roles/sap_hana_install/tasks/main.yml @@ -1,6 +1,14 @@ # SPDX-License-Identifier: Apache-2.0 --- +# Fail when more than one tag is used +- name: SAP HANA - Main - Fail if more than one tag is used + ansible.builtin.fail: + msg: "This role supports only one tag at a time." + when: ansible_run_tags|d([]) | count > 1 + tags: + - always + # SAP HANA - name: SAP HANA - Main - Prepare some variables ansible.builtin.include_tasks: @@ -15,13 +23,16 @@ ansible.builtin.include_tasks: file: pre_tasks/hana_exists.yml apply: - tags: sap_hana_install_check_hana_exists + tags: + - sap_hana_install_check_hana_exists + - sap_hana_install_check_installation when: - (sap_hana_install_new_system and not sap_hana_install_force) or not sap_hana_install_new_system tags: - sap_hana_install_hdblcm_commandline - sap_hana_install_check_hana_exists + - sap_hana_install_check_installation - name: SAP HANA - Main - Identify hosts in play based on addhosts @@ -67,6 +78,7 @@ - name: SAP HANA - Install - Post-tasks ansible.builtin.include_tasks: file: post_install.yml + when: __sap_hana_install_fact_is_installed tags: sap_hana_install_check_installation diff --git a/roles/sap_hana_install/tasks/pre_tasks/prepare_variables.yml b/roles/sap_hana_install/tasks/pre_tasks/prepare_variables.yml index d60f0572..47c32ef3 100644 --- a/roles/sap_hana_install/tasks/pre_tasks/prepare_variables.yml +++ b/roles/sap_hana_install/tasks/pre_tasks/prepare_variables.yml @@ -19,7 +19,9 @@ else sap_hana_install_number }}" sap_hana_install_system_usage: "{{ sap_hana_install_env_type | d(sap_hana_install_system_usage) | d('custom') }}" sap_hana_install_restrict_max_mem: "{{ sap_hana_install_mem_restrict | d(sap_hana_install_restrict_max_mem) | d('n') }}" - tags: sap_hana_install_check_hana_exists + tags: + - sap_hana_install_check_hana_exists + - sap_hana_install_check_installation # SID - name: SAP HANA - Pre-Tasks - Assert that the variable 'sap_hana_install_sid' is defined as String consisting of 3 characters From c65428bad443df6cdfe5effe66d356e5bd3b46ed Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Fri, 5 Dec 2025 20:35:48 +0100 Subject: [PATCH 3/7] sap_hana_install: Improve README.md about max. tags Relates to #1137. Signed-off-by: Bernd Finger --- roles/sap_hana_install/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_hana_install/README.md b/roles/sap_hana_install/README.md index feef3f49..1580cad5 100644 --- a/roles/sap_hana_install/README.md +++ b/roles/sap_hana_install/README.md @@ -377,7 +377,7 @@ Installs SAP HANA on `host1` and `host2`, while running on host `host0` where ex ### Role Tags -Note: This role can only be used with one tag at a time. +Note: When using tags, only one tag at a time is possible. With the following tags, the role can be called to perform certain activities only: - tag `sap_hana_install_hdblcm_commandline`: Only show the hdblcm command line, without processing From 1af885e4195e73f0118e0030e22c1e5aa437e253 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Mon, 8 Dec 2025 22:50:26 +0100 Subject: [PATCH 4/7] sap_hana_install: fixes after first round of review The tag sap_hana_install_check_installation has been removed in this commit, for reducing complexity and testing efforts. Relates to #1137. Signed-off-by: Bernd Finger --- roles/sap_hana_install/README.md | 2 +- roles/sap_hana_install/tasks/hana_install.yml | 4 -- roles/sap_hana_install/tasks/main.yml | 38 +++++++++---------- roles/sap_hana_install/tasks/post_install.yml | 11 ++---- roles/sap_hana_install/tasks/pre_addhosts.yml | 6 +-- roles/sap_hana_install/tasks/pre_install.yml | 8 ++-- .../pre_tasks/prepare_software_addhosts.yml | 7 +--- .../pre_tasks/prepare_software_install.yml | 7 +--- .../tasks/pre_tasks/prepare_variables.yml | 7 ---- 9 files changed, 32 insertions(+), 58 deletions(-) diff --git a/roles/sap_hana_install/README.md b/roles/sap_hana_install/README.md index 1580cad5..31f367bf 100644 --- a/roles/sap_hana_install/README.md +++ b/roles/sap_hana_install/README.md @@ -386,7 +386,6 @@ With the following tags, the role can be called to perform certain activities on - tag `sap_hana_install_create_configfile`: Only generate the hdblcm configfile. - tag `sap_hana_install_check_hana_exists`: Only check if there is already HANA installed with the desired SID and instance number. -- tag `sap_hana_install_check_installation`: Only perform a SAP HANA installation check The following tags have been removed in this release: - tag `sap_hana_install_preinstall` @@ -399,6 +398,7 @@ The following tags have been removed in this release: - tag `sap_hana_install_generate_input_file` - tag `sap_hana_install_store_connection_information` - tag `sap_hana_install_set_log_mode` +- tag `sap_hana_install_check_installation`
How to run sap_hana_install with tags diff --git a/roles/sap_hana_install/tasks/hana_install.yml b/roles/sap_hana_install/tasks/hana_install.yml index 71120e42..a3ee2e9e 100644 --- a/roles/sap_hana_install/tasks/hana_install.yml +++ b/roles/sap_hana_install/tasks/hana_install.yml @@ -65,10 +65,6 @@ register: __sap_hana_install_register_sapinst failed_when: __sap_hana_install_register_sapinst.finished != 1 or __sap_hana_install_register_sapinst.rc != 0 -- name: SAP HANA - Install - Set SAP HANA is_installed flag - ansible.builtin.set_fact: - __sap_hana_install_fact_is_installed: true - - name: SAP HANA - Install - Display the hdblcm output ansible.builtin.debug: msg: | diff --git a/roles/sap_hana_install/tasks/main.yml b/roles/sap_hana_install/tasks/main.yml index c4af4045..d05bc3fb 100644 --- a/roles/sap_hana_install/tasks/main.yml +++ b/roles/sap_hana_install/tasks/main.yml @@ -6,17 +6,15 @@ ansible.builtin.fail: msg: "This role supports only one tag at a time." when: ansible_run_tags|d([]) | count > 1 - tags: - - always + tags: always # SAP HANA - name: SAP HANA - Main - Prepare some variables ansible.builtin.include_tasks: file: pre_tasks/prepare_variables.yml - tags: - - sap_hana_install_hdblcm_commandline - - sap_hana_install_check_hana_exists - - sap_hana_install_check_installation + apply: + tags: always + tags: always # SAP HANA presence has to be validated for both new system and adding new hosts. - name: SAP HANA - Main - Validate presence of existing SAP HANA database @@ -25,14 +23,12 @@ apply: tags: - sap_hana_install_check_hana_exists - - sap_hana_install_check_installation when: - (sap_hana_install_new_system and not sap_hana_install_force) or not sap_hana_install_new_system tags: - sap_hana_install_hdblcm_commandline - sap_hana_install_check_hana_exists - - sap_hana_install_check_installation - name: SAP HANA - Main - Identify hosts in play based on addhosts @@ -54,10 +50,9 @@ # - Configuration - Run always to ensure idempotent outcome. - name: Block for Installation tasks - when: sap_hana_install_new_system -# sap_hana_install_new_system or -# ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) or -# ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) + when: sap_hana_install_new_system or + ('sap_hana_install_create_configfile' in ansible_run_tags | d([])) or + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags | d([])) block: - name: SAP HANA - Install - Pre-Tasks ansible.builtin.include_tasks: @@ -65,29 +60,27 @@ tags: - sap_hana_install_create_configfile - sap_hana_install_hdblcm_commandline - - sap_hana_install_check_installation - name: SAP HANA - Install ansible.builtin.include_tasks: file: hana_install.yml when: > (not __sap_hana_install_fact_is_installed and __sap_hana_install_fact_is_main_host) or - ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags | d([])) tags: sap_hana_install_hdblcm_commandline - name: SAP HANA - Install - Post-tasks ansible.builtin.include_tasks: file: post_install.yml when: __sap_hana_install_fact_is_installed - tags: sap_hana_install_check_installation - name: Block for Addhosts tasks when: > not sap_hana_install_new_system and ((__sap_hana_install_fact_is_scaleout and __sap_hana_install_fact_is_installed) or - ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) or - ('sap_hana_install_create_configfile' in ansible_run_tags|d([]))) + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags | d([])) or + ('sap_hana_install_create_configfile' in ansible_run_tags | d([]))) block: # Execute only if new hosts are to be added. - name: SAP HANA - Addhosts - Pre-Tasks @@ -95,8 +88,8 @@ file: pre_addhosts.yml when: > (__sap_hana_install_fact_addhosts_hosts_new | d([]) | length > 0) or - ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) or - ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags | d([])) or + ('sap_hana_install_create_configfile' in ansible_run_tags | d([])) tags: - sap_hana_install_hdblcm_commandline - sap_hana_install_create_configfile @@ -106,8 +99,11 @@ file: hana_addhosts.yml when: (__sap_hana_install_fact_addhosts_hosts_new | d([]) | length > 0 and __sap_hana_install_fact_is_main_host) or - ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) - tags: sap_hana_install_hdblcm_commandline + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags | d([])) or + ('sap_hana_install_create_configfile' in ansible_run_tags | d([])) + tags: + - sap_hana_install_hdblcm_commandline + - sap_hana_install_create_configfile - name: SAP HANA - Addhosts - Post-tasks ansible.builtin.include_tasks: diff --git a/roles/sap_hana_install/tasks/post_install.yml b/roles/sap_hana_install/tasks/post_install.yml index 55b4111c..c7c2b7dd 100644 --- a/roles/sap_hana_install/tasks/post_install.yml +++ b/roles/sap_hana_install/tasks/post_install.yml @@ -3,9 +3,9 @@ # Installation tasks that can be destructive and should never be executed on existing database. - name: Block with tasks for new HANA Systems - when: > - (not __sap_hana_install_fact_is_installed and __sap_hana_install_fact_is_main_host) or - ('sap_hana_install_check_installation' in ansible_run_tags|d([])) + when: + - not __sap_hana_install_fact_is_installed + - __sap_hana_install_fact_is_main_host block: - name: SAP HANA - Install - Post-Tasks - Set log_mode @@ -25,10 +25,7 @@ - name: SAP HANA - Install - Post-Tasks - Perform an hdblcm installation check ansible.builtin.include_tasks: file: post_tasks/check_installation.yml - apply: - tags: sap_hana_install_check_installation - when: sap_hana_install_check_installation or ('sap_hana_install_check_installation' in ansible_run_tags|d([])) - tags: sap_hana_install_check_installation + when: sap_hana_install_check_installation | d(false) - name: SAP HANA - Install - Post-Tasks - Generate Input File for SAP Application Deployment '{{ sap_hana_install_nw_input_location }}/{{ sap_hana_install_sid }}.info.nw.install' diff --git a/roles/sap_hana_install/tasks/pre_addhosts.yml b/roles/sap_hana_install/tasks/pre_addhosts.yml index a07242bd..cb9004ac 100644 --- a/roles/sap_hana_install/tasks/pre_addhosts.yml +++ b/roles/sap_hana_install/tasks/pre_addhosts.yml @@ -66,8 +66,8 @@ file: pre_tasks/prepare_software_addhosts.yml when: > __sap_hana_install_fact_is_main_host or - ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) or - ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags | d([])) or + ('sap_hana_install_create_configfile' in ansible_run_tags | d([])) tags: - sap_hana_install_hdblcm_commandline - sap_hana_install_create_configfile @@ -96,5 +96,5 @@ file: pre_tasks/hdblcm_configfile.yml apply: tags: sap_hana_install_create_configfile - when: __sap_hana_install_fact_is_main_host or ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) + when: __sap_hana_install_fact_is_main_host or ('sap_hana_install_create_configfile' in ansible_run_tags | d([])) tags: sap_hana_install_create_configfile diff --git a/roles/sap_hana_install/tasks/pre_install.yml b/roles/sap_hana_install/tasks/pre_install.yml index 4268bccc..10855cdf 100644 --- a/roles/sap_hana_install/tasks/pre_install.yml +++ b/roles/sap_hana_install/tasks/pre_install.yml @@ -26,13 +26,11 @@ tags: sap_hana_install_create_configfile when: > __sap_hana_install_fact_is_main_host or - ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) or - ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) or - ('sap_hana_install_check_installation' in ansible_run_tags|d([])) + ('sap_hana_install_create_configfile' in ansible_run_tags | d([])) or + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags | d([])) tags: - sap_hana_install_create_configfile - sap_hana_install_hdblcm_commandline - - sap_hana_install_check_installation # Proper idempotency needs to check existing version, not just existence. @@ -62,5 +60,5 @@ tags: sap_hana_install_create_configfile when: > (not __sap_hana_install_fact_is_installed and __sap_hana_install_fact_is_main_host) or - ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) + ('sap_hana_install_create_configfile' in ansible_run_tags | d([])) tags: sap_hana_install_create_configfile diff --git a/roles/sap_hana_install/tasks/pre_tasks/prepare_software_addhosts.yml b/roles/sap_hana_install/tasks/pre_tasks/prepare_software_addhosts.yml index 28b0a7f1..e1b25687 100644 --- a/roles/sap_hana_install/tasks/pre_tasks/prepare_software_addhosts.yml +++ b/roles/sap_hana_install/tasks/pre_tasks/prepare_software_addhosts.yml @@ -53,17 +53,14 @@ tags: - sap_hana_install_hdblcm_commandline - sap_hana_install_create_configfile - - sap_hana_install_check_installation - name: SAP HANA - Addhosts - Pre-Tasks - Fill variable __sap_hana_install_register_tmpdir for check mode only ansible.builtin.set_fact: __sap_hana_install_register_tmpdir: path: '/tmp' when: ansible_check_mode or - ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) or - ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) or - ('sap_hana_install_check_installation' in ansible_run_tags|d([])) + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags | d([])) or + ('sap_hana_install_create_configfile' in ansible_run_tags | d([])) tags: - sap_hana_install_hdblcm_commandline - sap_hana_install_create_configfile - - sap_hana_install_check_installation diff --git a/roles/sap_hana_install/tasks/pre_tasks/prepare_software_install.yml b/roles/sap_hana_install/tasks/pre_tasks/prepare_software_install.yml index 198f40c5..57bd60c8 100644 --- a/roles/sap_hana_install/tasks/pre_tasks/prepare_software_install.yml +++ b/roles/sap_hana_install/tasks/pre_tasks/prepare_software_install.yml @@ -134,17 +134,14 @@ tags: - sap_hana_install_hdblcm_commandline - sap_hana_install_create_configfile - - sap_hana_install_check_installation - name: SAP HANA - Install - Pre-Tasks - Fill variable __sap_hana_install_register_tmpdir for check mode only ansible.builtin.set_fact: __sap_hana_install_register_tmpdir: path: '/tmp' when: ansible_check_mode or - ('sap_hana_install_hdblcm_commandline' in ansible_run_tags|d([])) or - ('sap_hana_install_create_configfile' in ansible_run_tags|d([])) or - ('sap_hana_install_check_installation' in ansible_run_tags|d([])) + ('sap_hana_install_hdblcm_commandline' in ansible_run_tags | d([])) or + ('sap_hana_install_create_configfile' in ansible_run_tags | d([])) tags: - sap_hana_install_hdblcm_commandline - sap_hana_install_create_configfile - - sap_hana_install_check_installation diff --git a/roles/sap_hana_install/tasks/pre_tasks/prepare_variables.yml b/roles/sap_hana_install/tasks/pre_tasks/prepare_variables.yml index 47c32ef3..ff74d7ff 100644 --- a/roles/sap_hana_install/tasks/pre_tasks/prepare_variables.yml +++ b/roles/sap_hana_install/tasks/pre_tasks/prepare_variables.yml @@ -19,9 +19,6 @@ else sap_hana_install_number }}" sap_hana_install_system_usage: "{{ sap_hana_install_env_type | d(sap_hana_install_system_usage) | d('custom') }}" sap_hana_install_restrict_max_mem: "{{ sap_hana_install_mem_restrict | d(sap_hana_install_restrict_max_mem) | d('n') }}" - tags: - - sap_hana_install_check_hana_exists - - sap_hana_install_check_installation # SID - name: SAP HANA - Pre-Tasks - Assert that the variable 'sap_hana_install_sid' is defined as String consisting of 3 characters @@ -76,10 +73,6 @@ if sap_hana_install_master_password is not defined or sap_hana_install_master_password | string | length == 0 else sap_hana_install_master_password }}" no_log: true # Required for password handling - tags: - - sap_hana_install_hdblcm_commandline - - sap_hana_install_check_hana_exists - - sap_hana_install_check_installation - name: SAP HANA - Pre-Tasks - Assert that the variable 'sap_hana_install_master_password' is defined as String and not empty ansible.builtin.assert: From 3b802d75d33a3eb2ff7249f353f08885ee58692b Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Tue, 9 Dec 2025 09:45:10 +0100 Subject: [PATCH 5/7] sap_hana_install: Remove superflous tag in tasks/main.yml Relates to #1137. Signed-off-by: Bernd Finger --- roles/sap_hana_install/tasks/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/sap_hana_install/tasks/main.yml b/roles/sap_hana_install/tasks/main.yml index d05bc3fb..dcdd42da 100644 --- a/roles/sap_hana_install/tasks/main.yml +++ b/roles/sap_hana_install/tasks/main.yml @@ -27,7 +27,6 @@ - (sap_hana_install_new_system and not sap_hana_install_force) or not sap_hana_install_new_system tags: - - sap_hana_install_hdblcm_commandline - sap_hana_install_check_hana_exists From f3663175a8b5b86335531271193d2c4db7ed0631 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 10 Dec 2025 15:12:06 +0100 Subject: [PATCH 6/7] sap_hana_install: fixed remaining jinja[spacing] Signed-off-by: Bernd Finger --- roles/sap_hana_install/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_hana_install/tasks/main.yml b/roles/sap_hana_install/tasks/main.yml index dcdd42da..7faedb1b 100644 --- a/roles/sap_hana_install/tasks/main.yml +++ b/roles/sap_hana_install/tasks/main.yml @@ -5,7 +5,7 @@ - name: SAP HANA - Main - Fail if more than one tag is used ansible.builtin.fail: msg: "This role supports only one tag at a time." - when: ansible_run_tags|d([]) | count > 1 + when: ansible_run_tags | d([]) | count > 1 tags: always # SAP HANA From 2341f2b5f21991bcec15714d9270f0deef8ca70b Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 10 Dec 2025 15:15:57 +0100 Subject: [PATCH 7/7] sap_hana_install: remove superfluous tag sap_hana_install_hdblcm_commandline, from tasks/main.yml. Signed-off-by: Bernd Finger --- roles/sap_hana_install/tasks/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/sap_hana_install/tasks/main.yml b/roles/sap_hana_install/tasks/main.yml index 7faedb1b..e1ec5da2 100644 --- a/roles/sap_hana_install/tasks/main.yml +++ b/roles/sap_hana_install/tasks/main.yml @@ -33,7 +33,6 @@ - name: SAP HANA - Main - Identify hosts in play based on addhosts ansible.builtin.include_tasks: file: pre_tasks/identify_hosts.yml - tags: sap_hana_install_hdblcm_commandline - name: SAP HANA - Main - Ensure SAP HANA is running for existing systems or addhosts operations