diff --git a/roles/sap_hana_install/README.md b/roles/sap_hana_install/README.md index 121444d3..31f367bf 100644 --- a/roles/sap_hana_install/README.md +++ b/roles/sap_hana_install/README.md @@ -377,59 +377,45 @@ Installs SAP HANA on `host1` and `host2`, while running on host `host0` where ex ### Role Tags +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_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. + +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` +- tag `sap_hana_install_check_installation`
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..e1ec5da2 100644 --- a/roles/sap_hana_install/tasks/main.yml +++ b/roles/sap_hana_install/tasks/main.yml @@ -1,27 +1,33 @@ # 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: file: pre_tasks/prepare_variables.yml - 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 + 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 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_check_hana_exists - - sap_hana_install_preinstall - name: SAP HANA - Main - Identify hosts in play based on addhosts @@ -42,45 +48,60 @@ # - Configuration - Run always to ensure idempotent outcome. - name: Block for Installation tasks - when: - - sap_hana_install_new_system + 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: file: pre_install.yml + tags: + - sap_hana_install_create_configfile + - sap_hana_install_hdblcm_commandline - 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 + when: __sap_hana_install_fact_is_installed - 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([])) 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_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..c7c2b7dd 100644 --- a/roles/sap_hana_install/tasks/post_install.yml +++ b/roles/sap_hana_install/tasks/post_install.yml @@ -11,7 +11,6 @@ - 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: @@ -27,7 +26,6 @@ ansible.builtin.include_tasks: file: post_tasks/check_installation.yml when: sap_hana_install_check_installation | d(false) - tags: sap_hana_install_check_installation - 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' @@ -39,7 +37,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 +62,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 +80,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..cb9004ac 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..10855cdf 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,15 @@ - 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([])) + tags: + - sap_hana_install_create_configfile + - sap_hana_install_hdblcm_commandline # Proper idempotency needs to check existing version, not just existence. @@ -45,11 +52,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..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 @@ -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,15 @@ register: __sap_hana_install_register_tmpdir tags: - sap_hana_install_hdblcm_commandline - - sap_hana_install_check_installation + - sap_hana_install_create_configfile - 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([])) + tags: + - sap_hana_install_hdblcm_commandline + - sap_hana_install_create_configfile 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..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 @@ -133,10 +133,15 @@ when: not __sap_hana_install_fact_is_installed tags: - sap_hana_install_hdblcm_commandline - - sap_hana_install_check_installation + - sap_hana_install_create_configfile - 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([])) + tags: + - sap_hana_install_hdblcm_commandline + - sap_hana_install_create_configfile 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..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,12 +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 - - sap_hana_install_preinstall - - sap_hana_install_set_log_mode - - sap_hana_install_configure_firewall # SID - name: SAP HANA - Pre-Tasks - Assert that the variable 'sap_hana_install_sid' is defined as String consisting of 3 characters @@ -79,12 +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_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: