diff --git a/roles/sap_hana_preconfigure/README.md b/roles/sap_hana_preconfigure/README.md index 866f53167..acedf8bc6 100644 --- a/roles/sap_hana_preconfigure/README.md +++ b/roles/sap_hana_preconfigure/README.md @@ -396,7 +396,7 @@ List of interfaces for which the MTU size will be set to `9000`.
### sap_hana_preconfigure_ppcle_tso_if - _Type:_ `list` with elements of type `str` -- _Default:_ `'{{ ansible_interfaces | difference([''lo'']) }}'` +- _Default:_ `'{{ ansible_facts['interfaces'] | difference([''lo'']) }}'` List of interfaces for which the tso flag will be set.
diff --git a/roles/sap_hana_preconfigure/defaults/main.yml b/roles/sap_hana_preconfigure/defaults/main.yml index 65c53e459..d0966c2cf 100644 --- a/roles/sap_hana_preconfigure/defaults/main.yml +++ b/roles/sap_hana_preconfigure/defaults/main.yml @@ -157,7 +157,7 @@ sap_hana_preconfigure_ibm_power_repo_url: "{{ __sap_hana_preconfigure_ibm_power_ sap_hana_preconfigure_ppcle_mtu9000_if: '' # (Red Hat specific) List of interfaces for which the tso flag will be set. -sap_hana_preconfigure_ppcle_tso_if: "{{ ansible_interfaces | difference(['lo']) }}" +sap_hana_preconfigure_ppcle_tso_if: "{{ ansible_facts['interfaces'] | difference(['lo']) }}" # (Red Hat specific) Use tuned for configuring most of the kernel settings for SAP HANA # Set this parameter to `false` to use static kernel settings diff --git a/roles/sap_hana_preconfigure/handlers/main.yml b/roles/sap_hana_preconfigure/handlers/main.yml index 5e1e29e6e..a6b7b908a 100644 --- a/roles/sap_hana_preconfigure/handlers/main.yml +++ b/roles/sap_hana_preconfigure/handlers/main.yml @@ -46,14 +46,14 @@ __sap_hana_preconfigure_uefi_boot_dir: /boot/efi/EFI/redhat/grub.cfg listen: __sap_hana_preconfigure_regenerate_grub2_conf_handler when: - - ansible_distribution == 'RedHat' + - ansible_facts['distribution'] == 'RedHat' - name: "Set the grub.cfg location SLES" ansible.builtin.set_fact: __sap_hana_preconfigure_uefi_boot_dir: /boot/efi/EFI/BOOT/grub.cfg listen: __sap_hana_preconfigure_regenerate_grub2_conf_handler when: - - ansible_distribution == 'SLES' or ansible_distribution == 'SLES_SAP' + - ansible_facts['distribution'] == 'SLES' or ansible_facts['distribution'] == 'SLES_SAP' - name: "Run grub-mkconfig (UEFI mode)" ansible.builtin.command: @@ -104,7 +104,7 @@ timeout: 30 listen: __sap_hana_preconfigure_reboot_handler when: - - ansible_os_family == 'Suse' + - ansible_facts['os_family'] == 'Suse' - sap_hana_preconfigure_reboot_ok | d(false) changed_when: false diff --git a/roles/sap_hana_preconfigure/meta/argument_specs.yml b/roles/sap_hana_preconfigure/meta/argument_specs.yml index 8830e8b2c..36fd11b7c 100644 --- a/roles/sap_hana_preconfigure/meta/argument_specs.yml +++ b/roles/sap_hana_preconfigure/meta/argument_specs.yml @@ -314,7 +314,7 @@ argument_specs: type: str sap_hana_preconfigure_ppcle_tso_if: - default: "{{ ansible_interfaces | difference(['lo']) }}" + default: "{{ ansible_facts['interfaces'] | difference(['lo']) }}" description: - List of interfaces for which the tso flag will be set. required: false diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml b/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml index 354f091f1..94e317fdc 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml @@ -6,21 +6,21 @@ - name: Assert that the system is running a RHEL release which is supported for SAP HANA ansible.builtin.assert: - that: ansible_distribution_version in sap_hana_preconfigure_supported_rhel_minor_releases + that: ansible_facts['distribution_version'] in sap_hana_preconfigure_supported_rhel_minor_releases fail_msg: - - "FAIL: The RHEL release '{{ ansible_distribution_version }}' may not (yet) be supported for SAP HANA. Please check SAP note 2235581!" + - "FAIL: The RHEL release '{{ ansible_facts['distribution_version'] }}' may not (yet) be supported for SAP HANA. Please check SAP note 2235581!" - "NOTE: If necessary, adapt role parameter `sap_hana_preconfigure_supported_rhel_minor_releases` accordingly." - success_msg: "PASS: The RHEL release {{ ansible_distribution_version }} is supported for SAP HANA." + success_msg: "PASS: The RHEL release {{ ansible_facts['distribution_version'] }} is supported for SAP HANA." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" when: sap_hana_preconfigure_min_rhel_release_check - name: Report if the RHEL release is supported for SAP HANA ansible.builtin.assert: - that: ansible_distribution_version in sap_hana_preconfigure_supported_rhel_minor_releases + that: ansible_facts['distribution_version'] in sap_hana_preconfigure_supported_rhel_minor_releases fail_msg: - - "WARN: The RHEL release '{{ ansible_distribution_version }}' may not (yet) be supported for SAP HANA. Please check SAP note 2235581!" + - "WARN: The RHEL release '{{ ansible_facts['distribution_version'] }}' may not (yet) be supported for SAP HANA. Please check SAP note 2235581!" - "NOTE: If necessary, adapt role parameter `sap_hana_preconfigure_supported_rhel_minor_releases` accordingly." - success_msg: "INFO: The RHEL release {{ ansible_distribution_version }} is supported for SAP HANA." + success_msg: "INFO: The RHEL release {{ ansible_facts['distribution_version'] }} is supported for SAP HANA." ignore_errors: yes when: not sap_hana_preconfigure_min_rhel_release_check @@ -28,7 +28,7 @@ - name: Fill the variable for the generic list of required repos ansible.builtin.set_fact: __sap_hana_preconfigure_required_repos: "{{ lookup('vars', '__sap_hana_preconfigure_req_repos_redhat_' + - ansible_distribution_version | string | replace(\".\", \"_\") + '_' + ansible_architecture | string) }}" + ansible_facts['distribution_version'] | string | replace(\".\", \"_\") + '_' + ansible_facts['architecture'] | string) }}" - name: Get info about enabled repos ansible.builtin.shell: set -o pipefail && subscription-manager repos --list-enabled | awk '/Repo ID:/{print $NF}' @@ -58,18 +58,18 @@ - name: Assert that the RHEL release is locked correctly ansible.builtin.assert: - that: __sap_hana_preconfigure_register_subscription_manager_release_assert.stdout == ansible_distribution_version + that: __sap_hana_preconfigure_register_subscription_manager_release_assert.stdout == ansible_facts['distribution_version'] fail_msg: "FAIL: The RHEL release lock status is '{{ __sap_hana_preconfigure_register_subscription_manager_release_assert.stdout }}' - but the expected value is '{{ ansible_distribution_version }}'!" - success_msg: "PASS: The RHEL release is correctly locked to '{{ ansible_distribution_version }}'." + but the expected value is '{{ ansible_facts['distribution_version'] }}'!" + success_msg: "PASS: The RHEL release is correctly locked to '{{ ansible_facts['distribution_version'] }}'." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" - when: "ansible_distribution_version != '7.9'" + when: "ansible_facts['distribution_version'] != '7.9'" - name: Report that checking the release lock is not necessary if the system is on RHEL 7.9 ansible.builtin.debug: - msg: "INFO: No need to check the release lock setting as the RHEL release {{ ansible_distribution_version }} - is the last RHEL {{ ansible_distribution_major_version }} minor release" - when: "ansible_distribution_version == '7.9'" + msg: "INFO: No need to check the release lock setting as the RHEL release {{ ansible_facts['distribution_version'] }} + is the last RHEL {{ ansible_facts['distribution_major_version'] }} minor release" + when: "ansible_facts['distribution_version'] == '7.9'" - name: Assert that all required packages are installed ansible.builtin.assert: @@ -96,7 +96,7 @@ register: __sap_hana_preconfigure_register_required_ppc64le_packages_assert changed_when: false when: - - ansible_architecture == "ppc64le" + - ansible_facts['architecture'] == "ppc64le" - sap_general_preconfigure_install_ibm_power_tools ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" @@ -110,7 +110,7 @@ loop_control: loop_var: line_item when: - - ansible_architecture == "ppc64le" + - ansible_facts['architecture'] == "ppc64le" - sap_general_preconfigure_install_ibm_power_tools ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}" @@ -208,22 +208,22 @@ ansible.builtin.set_fact: __sap_hana_preconfigure_fact_needs_restarting_command_assert: "needs-restarting -r" when: - - ansible_distribution_major_version == '7' + - ansible_facts['distribution_major_version'] == '7' - name: "Assert - Set needs-restarting command in case of RHEL 8 or greater, except RHEL 8.0" ansible.builtin.set_fact: __sap_hana_preconfigure_fact_needs_restarting_command_assert: "yum needs-restarting -r" when: - - ansible_distribution_major_version | int >= 8 - - ansible_distribution_version != '8.0' + - ansible_facts['distribution_major_version'] | int >= 8 + - ansible_facts['distribution_version'] != '8.0' - name: "Assert - Set customized needs-restarting command in case of RHEL 8.0" ansible.builtin.set_fact: __sap_hana_preconfigure_fact_needs_restarting_command_assert: "_IKRNL=$(rpm -q --last kernel | awk 'NR==1{sub(/kernel-/,\"\"); print $1}'); _CKRNL=$(uname -r); if [ ${_IKRNL} != ${_CKRNL} ]; then exit 1; else exit 0; fi" when: - - ansible_os_family == 'RedHat' - - ansible_distribution_version == '8.0' + - ansible_facts['os_family'] == 'RedHat' + - ansible_facts['distribution_version'] == '8.0' - name: Assert - Display the command for checking a reboot requirement ansible.builtin.debug: diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml index 8a4a54cd9..3d4ba11f0 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml @@ -3,7 +3,7 @@ # can be configured by tuned profile sap-hana, entry "force_latency=70" - name: Assert - Perform steps for checking the required C-State configuration - when: ansible_architecture == 'x86_64' and + when: ansible_facts['architecture'] == 'x86_64' and (not sap_hana_preconfigure_use_tuned or sap_hana_preconfigure_modify_grub_cmdline_linux or sap_hana_preconfigure_assert_all_config) diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml index da1205692..7775587cc 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml @@ -4,7 +4,7 @@ # can be configured by tuned profile sap-hana, entry "governor=performance" # in included tuned profile throughput-performance - name: Assert - Perform steps for checking the CPU Governor for performance - when: ansible_architecture == 'x86_64' and + when: ansible_facts['architecture'] == 'x86_64' and (not sap_hana_preconfigure_use_tuned or sap_hana_preconfigure_assert_all_config) block: diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-epb.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-epb.yml index 5aa99c3f3..f23e3c507 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-epb.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-epb.yml @@ -5,7 +5,7 @@ # in included tuned profile throughput-performance # More details on EPB are in: https://github.com/torvalds/linux/blob/be1fcde604e429691771ce70230668af8097e29b/arch/x86/kernel/cpu/intel_epb.c - name: Assert - Perform steps for checking EPB - when: ansible_architecture == 'x86_64' and + when: ansible_facts['architecture'] == 'x86_64' and (not sap_hana_preconfigure_use_tuned or sap_hana_preconfigure_assert_all_config) block: diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml index a693f4122..ff0864eaa 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-thp.yml @@ -29,10 +29,10 @@ __sap_hana_preconfigure_fact_thp_boot_command_line_arg: "transparent_hugepage=never" when: - sap_hana_preconfigure_thp is undefined or sap_hana_preconfigure_thp | length == 0 - - ansible_distribution_major_version == '7' or - ansible_distribution_major_version == '8' or - ansible_distribution_version == '9.0' or - ansible_distribution_version == '9.1' + - ansible_facts['distribution_major_version'] == '7' or + ansible_facts['distribution_major_version'] == '8' or + ansible_facts['distribution_version'] == '9.0' or + ansible_facts['distribution_version'] == '9.1' - name: Set fact for THP, RHEL 9.2 and later ansible.builtin.set_fact: @@ -40,8 +40,8 @@ __sap_hana_preconfigure_fact_thp_boot_command_line_arg: "transparent_hugepage=madvise" when: - sap_hana_preconfigure_thp is undefined or sap_hana_preconfigure_thp | length == 0 - - ansible_distribution_major_version | int >= 10 or - (ansible_distribution_major_version == '9' and + - ansible_facts['distribution_major_version'] | int >= 10 or + (ansible_facts['distribution_major_version'] == '9' and __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 2) # TODO: Replace with full validations for accepted values ['always', 'madvise', 'never'] diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml index 0f76834e2..252aed6e7 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/assert-tsx.yml @@ -3,10 +3,10 @@ - name: Assert - Perform steps for checking TSX when: - - ansible_architecture == 'x86_64' - - ansible_distribution == 'RedHat' - - ansible_distribution_major_version | int >= 9 or - (ansible_distribution_major_version == '8' and + - ansible_facts['architecture'] == 'x86_64' + - ansible_facts['distribution'] == 'RedHat' + - ansible_facts['distribution_major_version'] | int >= 9 or + (ansible_facts['distribution_major_version'] == '8' and __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int >= 3) block: diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-c-states-for-lower-latency.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-c-states-for-lower-latency.yml index e1d38959e..a4d9ea18f 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-c-states-for-lower-latency.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-c-states-for-lower-latency.yml @@ -11,4 +11,4 @@ loop_var: __sap_hana_preconfigure_kernel_arg_line_item when: - __sap_hana_preconfigure_boot_command_line_args['c-states']['arch'] is defined - - ansible_architecture in __sap_hana_preconfigure_boot_command_line_args['c-states']['arch'] + - ansible_facts['architecture'] in __sap_hana_preconfigure_boot_command_line_args['c-states']['arch'] diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml index b149ef84d..b22978eda 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml @@ -5,7 +5,7 @@ # in included tuned profile throughput-performance - name: Perform steps for configuring the CPU Governor for performance when: - - ansible_architecture == 'x86_64' + - ansible_facts['architecture'] == 'x86_64' - not sap_hana_preconfigure_use_tuned block: diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-epb.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-epb.yml index 890d7dfa2..e67bcf159 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-epb.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-epb.yml @@ -6,7 +6,7 @@ # More details on EPB are in: https://github.com/torvalds/linux/blob/be1fcde604e429691771ce70230668af8097e29b/arch/x86/kernel/cpu/intel_epb.c - name: Perform steps for configuring EPB when: - - ansible_architecture == 'x86_64' + - ansible_facts['architecture'] == 'x86_64' - not sap_hana_preconfigure_use_tuned block: diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-selinux.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-selinux.yml index db8ca89c0..ade164b58 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-selinux.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-selinux.yml @@ -5,7 +5,7 @@ # the value of the 'mode' member ('permissive' or 'enforcing') - name: SELinux - Set an SELinux mode variable ansible.builtin.set_fact: - __sap_hana_preconfigure_fact_selinux_mode: "{{ (ansible_selinux.status == 'disabled') | ternary(ansible_selinux.status, ansible_selinux.mode) }}" + __sap_hana_preconfigure_fact_selinux_mode: "{{ (ansible_facts['selinux'].status == 'disabled') | ternary(ansible_facts['selinux'].status, ansible_facts['selinux'].mode) }}" - name: SELinux - Warn if the SELinux file contexts cannot be set ansible.builtin.debug: diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml index 6734bc2ab..54fcf6aaf 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-thp.yml @@ -16,7 +16,7 @@ __sap_hana_preconfigure_fact_thp: "{{ __sap_hana_preconfigure_boot_command_line_args['thp']['args'][0].split('=')[1] }}" when: - __sap_hana_preconfigure_boot_command_line_args['thp']['arch'] is defined - - ansible_architecture in __sap_hana_preconfigure_boot_command_line_args['thp']['arch'] + - ansible_facts['architecture'] in __sap_hana_preconfigure_boot_command_line_args['thp']['arch'] - sap_hana_preconfigure_thp is undefined or not sap_hana_preconfigure_thp is string or sap_hana_preconfigure_thp | length == 0 @@ -27,7 +27,7 @@ or ( __sap_hana_preconfigure_boot_command_line_args['thp']['arch'] is defined and - ansible_architecture in __sap_hana_preconfigure_boot_command_line_args['thp']['arch'] + ansible_facts['architecture'] in __sap_hana_preconfigure_boot_command_line_args['thp']['arch'] ) block: diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-tuned.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-tuned.yml index 7113de0e7..936c4f4d5 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-tuned.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/configure-tuned.yml @@ -4,8 +4,8 @@ - name: Perform specific steps for tuned profile on RHEL 8.0 ppc64le when: - sap_hana_preconfigure_use_tuned - - ansible_architecture == "ppc64le" - - ansible_distribution_version == "8.0" + - ansible_facts['architecture'] == "ppc64le" + - ansible_facts['distribution_version'] == "8.0" block: - name: RHEL 8.0 ppc64le - Create directory /etc/tuned/sap-hana-ppc64le diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/generic/enable-tsx.yml b/roles/sap_hana_preconfigure/tasks/RedHat/generic/enable-tsx.yml index d938dda7c..6cfcfd8f7 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/generic/enable-tsx.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/generic/enable-tsx.yml @@ -10,4 +10,4 @@ loop_var: __sap_hana_preconfigure_kernel_arg_line_item when: - __sap_hana_preconfigure_boot_command_line_args['tsx']['arch'] is defined - - ansible_architecture in __sap_hana_preconfigure_boot_command_line_args['tsx']['arch'] + - ansible_facts['architecture'] in __sap_hana_preconfigure_boot_command_line_args['tsx']['arch'] diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml b/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml index 61a28fdc9..d43b22c3c 100644 --- a/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml +++ b/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml @@ -11,19 +11,19 @@ - name: Report if the system is running a RHEL release which is supported for SAP HANA ansible.builtin.debug: msg: - - "WARN: The RHEL release '{{ ansible_distribution_version }}' may not (yet) be supported for SAP HANA. Please check SAP note 2235581!" + - "WARN: The RHEL release '{{ ansible_facts['distribution_version'] }}' may not (yet) be supported for SAP HANA. Please check SAP note 2235581!" - " If necessary, adapt role parameter `sap_hana_preconfigure_supported_rhel_minor_releases` accordingly." when: - not sap_hana_preconfigure_min_rhel_release_check - - ansible_distribution_version not in sap_hana_preconfigure_supported_rhel_minor_releases + - ansible_facts['distribution_version'] not in sap_hana_preconfigure_supported_rhel_minor_releases - name: Fail if the system is running a RHEL release which may not be supported for SAP HANA ansible.builtin.assert: - that: ansible_distribution_version in sap_hana_preconfigure_supported_rhel_minor_releases + that: ansible_facts['distribution_version'] in sap_hana_preconfigure_supported_rhel_minor_releases fail_msg: - - "The RHEL release '{{ ansible_distribution_version }}' may not (yet) be supported for SAP HANA. Please check SAP note 2235581!" + - "The RHEL release '{{ ansible_facts['distribution_version'] }}' may not (yet) be supported for SAP HANA. Please check SAP note 2235581!" - "If necessary, adapt role parameter `sap_hana_preconfigure_supported_rhel_minor_releases` accordingly." - success_msg: "The RHEL release '{{ ansible_distribution_version }}' is supported for SAP HANA." + success_msg: "The RHEL release '{{ ansible_facts['distribution_version'] }}' is supported for SAP HANA." when: sap_hana_preconfigure_min_rhel_release_check - name: Perform steps for enabling repos for SAP HANA @@ -34,7 +34,7 @@ - name: Fill the variable for the generic list of required repos ansible.builtin.set_fact: __sap_hana_preconfigure_fact_required_repos: "{{ lookup('vars', '__sap_hana_preconfigure_req_repos_redhat_' + - ansible_distribution_version | string | replace(\".\", \"_\") + '_' + ansible_architecture) }}" + ansible_facts['distribution_version'] | string | replace(\".\", \"_\") + '_' + ansible_facts['architecture']) }}" - name: Construct valid argument list to the subscription-manager repos command ansible.builtin.set_fact: @@ -59,11 +59,11 @@ - sap_hana_preconfigure_set_minor_release - name: Set the minor RHEL release - ansible.builtin.command: subscription-manager release --set="{{ ansible_distribution_version }}" + ansible.builtin.command: subscription-manager release --set="{{ ansible_facts['distribution_version'] }}" changed_when: true when: - sap_hana_preconfigure_set_minor_release - - __sap_hana_preconfigure_register_subscription_manager_release.stdout != ansible_distribution_version + - __sap_hana_preconfigure_register_subscription_manager_release.stdout != ansible_facts['distribution_version'] - name: Ensure required packages are installed ansible.builtin.package: @@ -94,7 +94,7 @@ state: present disable_gpg_check: True when: - - ansible_architecture == "ppc64le" + - ansible_facts['architecture'] == "ppc64le" - sap_hana_preconfigure_install_ibm_power_tools | d(true) - sap_hana_preconfigure_add_ibm_power_repo | d(true) @@ -102,7 +102,7 @@ ansible.builtin.shell: LESS=+q /opt/ibm/lop/configure <<<'y' changed_when: true when: - - ansible_architecture == "ppc64le" + - ansible_facts['architecture'] == "ppc64le" - sap_hana_preconfigure_install_ibm_power_tools | d(true) - sap_hana_preconfigure_add_ibm_power_repo | d(true) @@ -112,7 +112,7 @@ state: latest name: "{{ __sap_hana_preconfigure_required_ppc64le }}" when: - - ansible_architecture == "ppc64le" + - ansible_facts['architecture'] == "ppc64le" - sap_hana_preconfigure_install_ibm_power_tools | d(true) # The package module is sufficient to guarantee that the required packages are installed. @@ -125,12 +125,12 @@ # register: __sap_hana_preconfigure_register_required_ppc64le_packages # ignore_errors: True # changed_when: false -# when: ansible_architecture == "ppc64le" +# when: ansible_facts['architecture'] == "ppc64le" # # - name: ppc64le - Get status of installed packages # debug: # var: __sap_hana_preconfigure_register_required_ppc64le_packages.results -# when: ansible_architecture == "ppc64le" +# when: ansible_facts['architecture'] == "ppc64le" - name: Ensure that the minimum required package versions are installed when: @@ -203,20 +203,20 @@ ansible.builtin.set_fact: __sap_hana_preconfigure_fact_needs_restarting_command: "needs-restarting -r" when: - - ansible_distribution_major_version == '7' + - ansible_facts['distribution_major_version'] == '7' - name: "Set needs-restarting command in case of RHEL 8 or greater, except RHEL 8.0" ansible.builtin.set_fact: __sap_hana_preconfigure_fact_needs_restarting_command: "yum needs-restarting -r" when: - - ansible_distribution_major_version | int >= 8 - - ansible_distribution_version != '8.0' + - ansible_facts['distribution_major_version'] | int >= 8 + - ansible_facts['distribution_version'] != '8.0' - name: "Set customized needs-restarting command in case of RHEL 8.0" ansible.builtin.set_fact: __sap_hana_preconfigure_fact_needs_restarting_command: "_IKRNL=$(rpm -q --last kernel | awk 'NR==1{sub(/kernel-/,\"\"); print $1}'); _CKRNL=$(uname -r); if [ ${_IKRNL} != ${_CKRNL} ]; then exit 1; else exit 0; fi" when: - - ansible_distribution_version == '8.0' + - ansible_facts['distribution_version'] == '8.0' - name: Display the command for checking a reboot requirement ansible.builtin.debug: diff --git a/roles/sap_hana_preconfigure/tasks/SLES/generic/saptune_install.yml b/roles/sap_hana_preconfigure/tasks/SLES/generic/saptune_install.yml index de0fcbcaa..e8e3a2186 100644 --- a/roles/sap_hana_preconfigure/tasks/SLES/generic/saptune_install.yml +++ b/roles/sap_hana_preconfigure/tasks/SLES/generic/saptune_install.yml @@ -13,8 +13,8 @@ __sap_hana_preconfigure_use_saptune: false when: - '"SLES_SAP" not in __sap_hana_preconfigure_register_baseproduct.stat.lnk_target' - - '"SLES" in __sap_hana_preconfigure_register_baseproduct.stat.lnk_target - and ansible_distribution_major_version | int < 16' + - '"SLES" in __sap_hana_preconfigure_register_baseproduct.stat.lnk_target' + - ansible_facts['distribution_major_version'] | int < 16 - name: Block to ensure saptune is installed diff --git a/roles/sap_hana_preconfigure/tasks/SLES/generic/saptune_takeover.yml b/roles/sap_hana_preconfigure/tasks/SLES/generic/saptune_takeover.yml index 6ee01807a..6ca47e9ae 100644 --- a/roles/sap_hana_preconfigure/tasks/SLES/generic/saptune_takeover.yml +++ b/roles/sap_hana_preconfigure/tasks/SLES/generic/saptune_takeover.yml @@ -15,7 +15,7 @@ - __sap_hana_preconfigure_use_saptune - __sap_hana_preconfigure_register_saptune_check_before.rc != 0 # sapconf is not present on SLES 16 and takeover is not required. - - ansible_distribution_major_version | int < 16 + - ansible_facts['distribution_major_version'] | int < 16 block: - name: Check saptune version # noqa: command-instead-of-module ansible.builtin.command: diff --git a/roles/sap_hana_preconfigure/tasks/main.yml b/roles/sap_hana_preconfigure/tasks/main.yml index 954c4bf67..60f843469 100644 --- a/roles/sap_hana_preconfigure/tasks/main.yml +++ b/roles/sap_hana_preconfigure/tasks/main.yml @@ -7,7 +7,7 @@ - name: Examine the OS minor version ansible.builtin.set_fact: - __sap_hana_preconfigure_fact_ansible_distribution_minor_version: '{{ ansible_distribution_version.split(".")[1] }}' + __sap_hana_preconfigure_fact_ansible_distribution_minor_version: "{{ ansible_facts['distribution_version'].split('.')[1] }}" # Load variable files in the following order (example for SLES and SLES_SAP 15.6 and RHEL 9.2): # 1. Suse.yml / RedHat.yml - Specific to OS family. @@ -24,14 +24,14 @@ loop: "{{ __vars_files_major }}" vars: __vars_file_major: "{{ role_path }}/vars/{{ item }}" - __distribution_major: "{{ ansible_distribution ~ '_' ~ ansible_distribution_major_version }}" + __distribution_major: "{{ ansible_facts['distribution'] ~ '_' ~ ansible_facts['distribution_major_version'] }}" # Enables loading of shared vars between SLES and SLES_SAP - __distribution_split_major: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_major_version }}" + __distribution_split_major: "{{ ansible_facts['distribution'].split('_')[0] ~ '_' ~ ansible_facts['distribution_major_version'] }}" __vars_files_major: >- {{ [ - ansible_os_family ~ '.yml', - (ansible_distribution ~ '.yml') if ansible_distribution != ansible_os_family else None, + ansible_facts['os_family'] ~ '.yml', + (ansible_facts['distribution'] ~ '.yml') if ansible_facts['distribution'] != ansible_facts['os_family'] else None, (__distribution_split_major ~ '.yml') if __distribution_split_major != __distribution_major else None, __distribution_major ~ '.yml', ] | select('defined') | select('string') | list @@ -48,8 +48,8 @@ {%- set major_minor_plus = [] -%} {%- for minor_number in range(1, __sap_hana_preconfigure_fact_ansible_distribution_minor_version | int + 1, 1) -%} {%- set _ = major_minor_plus.append( - ansible_distribution ~ '_' ~ - ansible_distribution_major_version ~ '.' ~ + ansible_facts['distribution'] ~ '_' ~ + ansible_facts['distribution_major_version'] ~ '.' ~ (minor_number | string) ~ '.plus' ~ '.yml') -%} {%- endfor -%} @@ -58,7 +58,7 @@ {{ __distribution_major_minor_plus_yml | list }} when: - __vars_file_plus is file - - ansible_distribution == 'RedHat' + - ansible_facts['distribution'] == 'RedHat' # Step 3: Include any vars files which are valid only for the OS minor release - name: Include OS minor specific vars @@ -66,9 +66,9 @@ loop: "{{ __vars_files_minor }}" vars: __vars_file_minor: "{{ role_path }}/vars/{{ item }}" - __distribution_major_minor: "{{ ansible_distribution ~ '_' ~ ansible_distribution_version }}" + __distribution_major_minor: "{{ ansible_facts['distribution'] ~ '_' ~ ansible_facts['distribution_version'] }}" # Enables loading of shared vars between SLES and SLES_SAP - __distribution_split_major_minor: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_version }}" + __distribution_split_major_minor: "{{ ansible_facts['distribution'].split('_')[0] ~ '_' ~ ansible_facts['distribution_version'] }}" __vars_files_minor: >- {{ [ @@ -96,15 +96,15 @@ ansible.builtin.include_tasks: '{{ item }}/{{ __sap_hana_preconfigure_fact_assert_filename_prefix }}installation.yml' when: sap_hana_preconfigure_config_all | d(true) or sap_hana_preconfigure_installation | d(false) with_first_found: - - '{{ ansible_distribution.split("_")[0] }}' - - '{{ ansible_distribution }}' + - "{{ ansible_facts['distribution'].split('_')[0] }}" + - "{{ ansible_facts['distribution'] }}" - name: Include configuration.yml ansible.builtin.include_tasks: '{{ item }}/{{ __sap_hana_preconfigure_fact_assert_filename_prefix }}configuration.yml' when: sap_hana_preconfigure_config_all | d(true) or sap_hana_preconfigure_configuration | d(false) with_first_found: - - '{{ ansible_distribution.split("_")[0] }}' - - '{{ ansible_distribution }}' + - "{{ ansible_facts['distribution'].split('_')[0] }}" + - "{{ ansible_facts['distribution'] }}" # allow a reboot at the end of the preconfigure role - name: Flush handlers diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2009879.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2009879.yml index debcc6295..d1901b28b 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2009879.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2009879.yml @@ -14,8 +14,8 @@ # shell: | # yum repolist | awk ' # BEGIN {a=0} -# /rhel-{{ ansible_distribution_major_version }}-server-e[4u]s-rpms/ {a++} -# /rhel-sap-hana-for-rhel-{{ ansible_distribution_major_version }}-server-e[4u]s-rpms/ {a++} +# /rhel-{{ ansible_facts['distribution_major_version'] }}-server-e[4u]s-rpms/ {a++} +# /rhel-sap-hana-for-rhel-{{ ansible_facts['distribution_major_version'] }}-server-e[4u]s-rpms/ {a++} # END {print a}' # register: sap_hana_preconfigure_register_eus # changed_when: false @@ -35,4 +35,4 @@ (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2009879$') | first).version }}): SAP HANA Guidelines for RHEL 7 (pdf)" - name: Include 2009879_X.yml - ansible.builtin.include_tasks: 2009879_{{ ansible_distribution_major_version }}.yml + ansible.builtin.include_tasks: 2009879_{{ ansible_facts['distribution_major_version'] }}.yml diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2009879_7.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2009879_7.yml index 06ff0cb2f..69db8e707 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2009879_7.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2009879_7.yml @@ -33,7 +33,7 @@ - { src: 'libssl.so.1.0.1e', dest: 'libssl.so.1.0.1' } - { src: 'libcrypto.so.1.0.1e', dest: 'libcrypto.so.1.0.1' } when: - (ansible_distribution_version == '7.2') + (ansible_facts['distribution_version'] == '7.2') loop_control: loop_var: line_item @@ -46,7 +46,7 @@ - { src: 'libssl.so.10', dest: 'libssl.so.1.0.1' } - { src: 'libcrypto.so.10', dest: 'libcrypto.so.1.0.1' } when: - (ansible_distribution_version != '7.2') + (ansible_facts['distribution_version'] != '7.2') loop_control: loop_var: line_item diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml index 7f5043dad..9684e651b 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2055470.yml @@ -12,7 +12,7 @@ # Network_Configuration_for_HANA_Workloads_on_IBM_Power_Servers_V4.pdf - name: Perform configuration changes for ppc64le - when: ansible_architecture == 'ppc64le' + when: ansible_facts['architecture'] == 'ppc64le' block: - name: Configure - Display SAP note number 2055470 and its version diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml index f1765d28b..d647fb6ec 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml @@ -7,7 +7,7 @@ msg: "SAP note 2292690 Step 10: IBM EnergyScale for POWER8 Processor-Based Systems" - name: Check of package pseries-energy - when: ansible_architecture == "ppc64le" + when: ansible_facts['architecture'] == "ppc64le" block: # Reason for noqa: In assert mode, we do not enforce a certain configuration. diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-ibm-energyscale.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-ibm-energyscale.yml index a30e82ca3..07751cc1a 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-ibm-energyscale.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-ibm-energyscale.yml @@ -10,4 +10,4 @@ ansible.builtin.package: name: pseries-energy state: absent - when: ansible_architecture == "ppc64le" + when: ansible_facts['architecture'] == "ppc64le" diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml index f1039f835..562ba7313 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2382421.yml @@ -26,7 +26,7 @@ - name: Set net.core.wmem_max and net.core.rmem_max if necessary when: - not sap_hana_preconfigure_use_netapp_settings_nfs | d(false) - - not ansible_architecture == 'ppc64le' + - not ansible_facts['architecture'] == 'ppc64le' block: - name: Get the value of net.ipv4.tcp_wmem diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2684254.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2684254.yml index 09d9f8af2..03fb67f43 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/2684254.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/2684254.yml @@ -12,7 +12,7 @@ ansible.builtin.set_fact: # THP has different settings for each SP __sap_hana_preconfigure_grub_cmdline_2684254_thp: - "{{ 'never' if ansible_distribution_version is version('15.4', '<=') else 'madvise' }}" + "{{ 'never' if ansible_facts['distribution_version'] is version('15.4', '<=') else 'madvise' }}" - name: Set fact for SAP note number 2684254 - GRUB ansible.builtin.set_fact: diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879.yml b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879.yml index 296f33413..4c6e7c7cf 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879.yml @@ -16,4 +16,4 @@ ### Package installation is done in installation.yml - name: Import tasks from 'assert-2009879_X.yml' - ansible.builtin.include_tasks: assert-2009879_{{ ansible_distribution_major_version }}.yml + ansible.builtin.include_tasks: assert-2009879_{{ ansible_facts['distribution_major_version'] }}.yml diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879_7.yml b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879_7.yml index f65962c4d..6e9376728 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879_7.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2009879_7.yml @@ -25,7 +25,7 @@ block: - name: ... in case of RHEL 7.2 - when: "ansible_distribution_version == '7.2'" + when: "ansible_facts['distribution_version'] == '7.2'" block: - name: RHEL 7.2 - Get info about file /usr/lib64/libssl.so.1.0.1 @@ -85,7 +85,7 @@ when: __sap_hana_preconfigure_register_stat_libcrypto_rhel_72_assert.stat.exists - name: ... in case of RHEL 7.3 and above - when: "ansible_distribution_version != '7.2'" + when: "ansible_facts['distribution_version'] != '7.2'" block: - name: Get info about file /usr/lib64/libssl.so.1.0.1 diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2055470.yml b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2055470.yml index 39bc50b0c..4be459079 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2055470.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2055470.yml @@ -12,7 +12,7 @@ # Network_Configuration_for_HANA_Workloads_on_IBM_Power_Servers_V4.pdf - name: Assert ppc64le specific settings - when: ansible_architecture == 'ppc64le' + when: ansible_facts['architecture'] == 'ppc64le' block: - name: Assert - Display SAP note number 2055470 and its version diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2382421.yml b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2382421.yml index 824684ffb..d99bfdf96 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2382421.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2382421.yml @@ -44,7 +44,7 @@ when: - sap_hana_preconfigure_config_all | d(true) or sap_hana_preconfigure_2382421 | d(false) - not sap_hana_preconfigure_use_netapp_settings_nfs | d(false) - - not ansible_architecture == 'ppc64le' + - not ansible_facts['architecture'] == 'ppc64le' block: - name: 2382421 - Get the maximum value of net.ipv4.tcp_wmem diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2684254.yml b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2684254.yml index 09188349c..54d3d9264 100644 --- a/roles/sap_hana_preconfigure/tasks/sapnote/assert-2684254.yml +++ b/roles/sap_hana_preconfigure/tasks/sapnote/assert-2684254.yml @@ -12,7 +12,7 @@ ansible.builtin.set_fact: # THP has different settings for each SP __sap_hana_preconfigure_grub_cmdline_2684254_thp: - "{{ 'never' if ansible_distribution_version is version('15.4', '<=') else 'madvise' }}" + "{{ 'never' if ansible_facts['distribution_version'] is version('15.4', '<=') else 'madvise' }}" - name: Set fact for SAP note number 2684254 - GRUB ansible.builtin.set_fact: diff --git a/roles/sap_hana_preconfigure/vars/RedHat_10.yml b/roles/sap_hana_preconfigure/vars/RedHat_10.yml index d60812c9c..9be918936 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_10.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_10.yml @@ -128,7 +128,7 @@ __sap_hana_preconfigure_sapnotes_versions_ppc64le: - { number: '2382421', version: '47' } - { number: '3024346', version: '11' } -__sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_architecture) }}" +__sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_facts['architecture']) }}" # In SAP Note XXX, certain minimal required packages for the different RHEL 10 minor releases are listed. # The following will assign them properly to __sap_hana_preconfigure_min_pkgs. @@ -182,7 +182,7 @@ __sap_hana_preconfigure_min_packages_10_10_x86_64: [] __sap_hana_preconfigure_min_packages_10_10_ppc64le: [] -__sap_hana_preconfigure_min_pkgs: "{{ lookup('vars', '__sap_hana_preconfigure_min_packages_' + ansible_distribution_version | string | replace(\".\", \"_\") + '_' + ansible_architecture) }}" +__sap_hana_preconfigure_min_pkgs: "{{ lookup('vars', '__sap_hana_preconfigure_min_packages_' + ansible_facts['distribution_version'] | string | replace(\".\", \"_\") + '_' + ansible_facts['architecture']) }}" __sap_hana_preconfigure_packages: # SAP NOTE 3562909: diff --git a/roles/sap_hana_preconfigure/vars/RedHat_7.yml b/roles/sap_hana_preconfigure/vars/RedHat_7.yml index 2bfb73cb8..8b9588275 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_7.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_7.yml @@ -54,7 +54,7 @@ __sap_hana_preconfigure_sapnotes_versions_ppc64le: - { number: '2382421', version: '40' } - { number: '3024346', version: '10' } -__sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_architecture) }}" +__sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_facts['architecture']) }}" # In SAP Note 2235581, certain minimal required packages for the different RHEL 7 minor releases are listed. # The following will assign them properly to __sap_hana_preconfigure_min_pkgs. @@ -116,7 +116,7 @@ __sap_hana_preconfigure_min_packages_7_9_x86_64: __sap_hana_preconfigure_min_packages_7_9_ppc64le: - [ 'kernel', '3.10.0-1160.11.1.el7' ] -__sap_hana_preconfigure_min_pkgs: "{{ lookup('vars', '__sap_hana_preconfigure_min_packages_' + ansible_distribution_version | string | replace(\".\", \"_\") + '_' + ansible_architecture | string) }}" +__sap_hana_preconfigure_min_pkgs: "{{ lookup('vars', '__sap_hana_preconfigure_min_packages_' + ansible_facts['distribution_version'] | string | replace(\".\", \"_\") + '_' + ansible_facts['architecture'] | string) }}" __sap_hana_preconfigure_packages: # SAP note 2009879: diff --git a/roles/sap_hana_preconfigure/vars/RedHat_8.yml b/roles/sap_hana_preconfigure/vars/RedHat_8.yml index 2f384de48..a3b722da8 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_8.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_8.yml @@ -134,7 +134,7 @@ __sap_hana_preconfigure_sapnotes_versions_ppc64le: - { number: '2382421', version: '40' } - { number: '3024346', version: '10' } -__sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_architecture) }}" +__sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_facts['architecture']) }}" # In SAP Note 2777782, certain minimal required packages for the different RHEL 8 minor releases are listed. # The following will assign them properly to __sap_hana_preconfigure_min_pkgs. @@ -199,7 +199,7 @@ __sap_hana_preconfigure_min_packages_8_10_x86_64: __sap_hana_preconfigure_min_packages_8_10_ppc64le: - [ 'kernel', '4.18.0-553.16.1.el8_10' ] -__sap_hana_preconfigure_min_pkgs: "{{ lookup('vars', '__sap_hana_preconfigure_min_packages_' + ansible_distribution_version | string | replace(\".\", \"_\") + '_' + ansible_architecture) }}" +__sap_hana_preconfigure_min_pkgs: "{{ lookup('vars', '__sap_hana_preconfigure_min_packages_' + ansible_facts['distribution_version'] | string | replace(\".\", \"_\") + '_' + ansible_facts['architecture']) }}" __sap_hana_preconfigure_packages: # SAP NOTE 2772999: diff --git a/roles/sap_hana_preconfigure/vars/RedHat_9.yml b/roles/sap_hana_preconfigure/vars/RedHat_9.yml index 6f266cf84..aa42e9df7 100644 --- a/roles/sap_hana_preconfigure/vars/RedHat_9.yml +++ b/roles/sap_hana_preconfigure/vars/RedHat_9.yml @@ -131,7 +131,7 @@ __sap_hana_preconfigure_sapnotes_versions_ppc64le: - { number: '2382421', version: '47' } - { number: '3024346', version: '11' } -__sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_architecture) }}" +__sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars', '__sap_hana_preconfigure_sapnotes_versions_' + ansible_facts['architecture']) }}" # In SAP Note XXX, certain minimal required packages for the different RHEL 9 minor releases are listed. # The following will assign them properly to __sap_hana_preconfigure_min_pkgs. @@ -193,7 +193,7 @@ __sap_hana_preconfigure_min_packages_9_10_x86_64: __sap_hana_preconfigure_min_packages_9_10_ppc64le: -__sap_hana_preconfigure_min_pkgs: "{{ lookup('vars', '__sap_hana_preconfigure_min_packages_' + ansible_distribution_version | string | replace(\".\", \"_\") + '_' + ansible_architecture) }}" +__sap_hana_preconfigure_min_pkgs: "{{ lookup('vars', '__sap_hana_preconfigure_min_packages_' + ansible_facts['distribution_version'] | string | replace(\".\", \"_\") + '_' + ansible_facts['architecture']) }}" __sap_hana_preconfigure_packages: # SAP NOTE 3108316: diff --git a/roles/sap_hana_preconfigure/vars/SLES_15.yml b/roles/sap_hana_preconfigure/vars/SLES_15.yml index d285a447b..4c00f6298 100644 --- a/roles/sap_hana_preconfigure/vars/SLES_15.yml +++ b/roles/sap_hana_preconfigure/vars/SLES_15.yml @@ -40,8 +40,8 @@ __sap_hana_preconfigure_packages: # Recommended for System monitoring - cpupower - # - "{{ 'libcpupower0' if ansible_distribution_version.split('.')[1] | int < 6 else 'libcpupower1' }}" - - "{{ 'libcpupower0' if ansible_distribution_version is version('15.6', '<') else 'libcpupower1' }}" + # - "{{ 'libcpupower0' if ansible_facts['distribution_version'].split('.')[1] | int < 6 else 'libcpupower1' }}" + - "{{ 'libcpupower0' if ansible_facts['distribution_version'] is version('15.6', '<') else 'libcpupower1' }}" - libsensors4 # Additional packages diff --git a/roles/sap_hana_preconfigure/vars/SLES_SAP_15.yml b/roles/sap_hana_preconfigure/vars/SLES_SAP_15.yml index c9a5ebb40..365ee181d 100644 --- a/roles/sap_hana_preconfigure/vars/SLES_SAP_15.yml +++ b/roles/sap_hana_preconfigure/vars/SLES_SAP_15.yml @@ -39,8 +39,8 @@ __sap_hana_preconfigure_packages: # Recommended for System monitoring - cpupower - # - "{{ 'libcpupower0' if ansible_distribution_version.split('.')[1] | int < 6 else 'libcpupower1' }}" - - "{{ 'libcpupower0' if ansible_distribution_version is version('15.6', '<') else 'libcpupower1' }}" + # - "{{ 'libcpupower0' if ansible_facts['distribution_version'].split('.')[1] | int < 6 else 'libcpupower1' }}" + - "{{ 'libcpupower0' if ansible_facts['distribution_version'] is version('15.6', '<') else 'libcpupower1' }}" - libsensors4 # Additional packages