diff --git a/roles/sap_general_preconfigure/README.md b/roles/sap_general_preconfigure/README.md index 43419227f..2c61a6366 100644 --- a/roles/sap_general_preconfigure/README.md +++ b/roles/sap_general_preconfigure/README.md @@ -392,7 +392,7 @@ in variable `sap_general_preconfigure_sap_directories`.
### sap_general_preconfigure_size_of_tmpfs_gb - _Type:_ `str` -- _Default:_ `"{{ ((0.75 * (ansible_memtotal_mb + ansible_swaptotal_mb)) / 1024) | round | int }}"` +- _Default:_ `"{{ ((0.75 * (ansible_facts['memtotal_mb'] + ansible_facts['swaptotal_mb'])) / 1024) | round | int }}"` The size of the tmpfs in GB. The formula used here is mentioned in SAP note 941735.
@@ -433,20 +433,20 @@ The maximum length of the hostname. See SAP note 611361.
### sap_general_preconfigure_hostname - _Type:_ `str` -- _Default:_ `"{{ ansible_hostname }}"` +- _Default:_ `"{{ ansible_facts['hostname'] }}"` The hostname to be used for updating or checking `/etc/hosts` entries.
### sap_general_preconfigure_domain - _Type:_ `str` -- _Default:_ `"{{ ansible_domain }}"` +- _Default:_ `"{{ ansible_facts['domain'] }}"` The DNS domain name to be used for updating or checking `/etc/hosts` entries.
Mandatory parameter when sap_general_preconfigure_modify_etc_hosts is set to true.
### sap_general_preconfigure_ip - _Type:_ `str` -- _Default:_ `"{{ ansible_default_ipv4.address }}"` +- _Default:_ `"{{ ansible_facts['default_ipv4'].address }}"` The IPV4 address to be used for updating or checking `/etc/hosts` entries.
diff --git a/roles/sap_general_preconfigure/defaults/main.yml b/roles/sap_general_preconfigure/defaults/main.yml index 16f4aabae..f372de66e 100644 --- a/roles/sap_general_preconfigure/defaults/main.yml +++ b/roles/sap_general_preconfigure/defaults/main.yml @@ -145,7 +145,7 @@ sap_general_preconfigure_modify_selinux_labels: true # Set to `false` if you do not want to modify the SELinux labels for the SAP directories set # in variable `sap_general_preconfigure_sap_directories`. -sap_general_preconfigure_size_of_tmpfs_gb: "{{ ((0.75 * (ansible_memtotal_mb + ansible_swaptotal_mb)) / 1024) | round | int }}" +sap_general_preconfigure_size_of_tmpfs_gb: "{{ ((0.75 * (ansible_facts['memtotal_mb'] + ansible_facts['swaptotal_mb'])) / 1024) | round | int }}" # The size of the tmpfs in GB. The formula used here is mentioned in SAP note 941735. sap_general_preconfigure_modify_etc_hosts: true @@ -167,13 +167,13 @@ sap_general_preconfigure_ignore_dns_failures: true # report such errors and continue running the role. # If "global" variables are set, use those. If not, default to the values from gather_facts: -sap_general_preconfigure_ip: "{{ sap_ip | d(ansible_default_ipv4.address) }}" +sap_general_preconfigure_ip: "{{ sap_ip | d(ansible_facts['default_ipv4'].address) }}" # The IPV4 address to be used for updating or checking `/etc/hosts` entries. -sap_general_preconfigure_hostname: "{{ sap_hostname | d(ansible_hostname) }}" +sap_general_preconfigure_hostname: "{{ sap_hostname | d(ansible_facts['hostname']) }}" # The hostname to be used for updating or checking `/etc/hosts` entries. -sap_general_preconfigure_domain: "{{ sap_domain | d(ansible_domain) }}" +sap_general_preconfigure_domain: "{{ sap_domain | d(ansible_facts['domain']) }}" # The DNS domain name to be used for updating or checking `/etc/hosts` entries. # Mandatory parameter when sap_general_preconfigure_modify_etc_hosts is set to true. diff --git a/roles/sap_general_preconfigure/handlers/main.yml b/roles/sap_general_preconfigure/handlers/main.yml index 5a930e9fe..9430ffa61 100644 --- a/roles/sap_general_preconfigure/handlers/main.yml +++ b/roles/sap_general_preconfigure/handlers/main.yml @@ -46,14 +46,14 @@ __sap_general_preconfigure_uefi_boot_dir: /boot/efi/EFI/redhat/grub.cfg listen: __sap_general_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_general_preconfigure_uefi_boot_dir: /boot/efi/EFI/BOOT/grub.cfg listen: __sap_general_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: @@ -97,7 +97,7 @@ timeout: 30 listen: __sap_general_preconfigure_reboot_handler when: - - ansible_os_family == 'Suse' + - ansible_facts['os_family'] == 'Suse' - sap_general_preconfigure_reboot_ok | d(false) changed_when: false diff --git a/roles/sap_general_preconfigure/meta/argument_specs.yml b/roles/sap_general_preconfigure/meta/argument_specs.yml index 2f323d879..ea3b42bf4 100644 --- a/roles/sap_general_preconfigure/meta/argument_specs.yml +++ b/roles/sap_general_preconfigure/meta/argument_specs.yml @@ -296,7 +296,7 @@ argument_specs: type: bool sap_general_preconfigure_size_of_tmpfs_gb: - default: "{{ ((0.75 * (ansible_memtotal_mb + ansible_swaptotal_mb)) / 1024) | round | int }}" + default: "{{ ((0.75 * (ansible_facts['memtotal_mb'] + ansible_facts['swaptotal_mb'])) / 1024) | round | int }}" description: - The size of the tmpfs in GB. The formula used here is mentioned in SAP note 941735. required: false @@ -340,14 +340,14 @@ argument_specs: type: str sap_general_preconfigure_hostname: - default: "{{ ansible_hostname }}" + default: "{{ ansible_facts['hostname'] }}" description: - The hostname to be used for updating or checking `/etc/hosts` entries. required: false type: str sap_general_preconfigure_domain: - default: "{{ ansible_domain }}" + default: "{{ ansible_facts['domain'] }}" description: - The DNS domain name to be used for updating or checking `/etc/hosts` entries. - Mandatory parameter when `sap_general_preconfigure_modify_etc_hosts` is set to true. @@ -355,7 +355,7 @@ argument_specs: type: str sap_general_preconfigure_ip: - default: "{{ ansible_default_ipv4.address }}" + default: "{{ ansible_facts['default_ipv4'].address }}" description: - The IPV4 address to be used for updating or checking `/etc/hosts` entries. required: false diff --git a/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml b/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml index 3773d7ad0..4731c836d 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml @@ -34,7 +34,7 @@ __sap_general_preconfigure_req_ha_repos | list }}" when: - sap_general_preconfigure_req_repos is undefined - - ansible_architecture != 's390x' + - ansible_facts['architecture'] != 's390x' - name: Assert - Set final list of repos, s390x, auto ansible.builtin.set_fact: @@ -44,7 +44,7 @@ __sap_general_preconfigure_req_ha_repos | list }}" when: - sap_general_preconfigure_req_repos is undefined - - ansible_architecture == 's390x' + - ansible_facts['architecture'] == 's390x' - name: Assert - Set final list of repos, manual ansible.builtin.set_fact: @@ -79,24 +79,24 @@ - name: Assert that the RHEL release is locked correctly ansible.builtin.assert: - that: __sap_general_preconfigure_register_subscription_manager_release_assert.stdout == ansible_distribution_version + that: __sap_general_preconfigure_register_subscription_manager_release_assert.stdout == ansible_facts['distribution_version'] fail_msg: "FAIL: The RHEL release lock status is '{{ __sap_general_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_general_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'" # Reason for noqa: A double brace might also occur in an awk command sequence. - name: Check RHEL 7 package groups when: - sap_general_preconfigure_packagegroups | length > 0 - - ansible_distribution_major_version == '7' + - ansible_facts['distribution_major_version'] == '7' block: - name: Set yum group list installed command # noqa jinja[spacing] @@ -125,7 +125,7 @@ - name: Check RHEL 8 environment groups when: - sap_general_preconfigure_envgroups | length > 0 - - ansible_distribution_major_version == '8' + - ansible_facts['distribution_major_version'] == '8' block: - name: Set yum envgroup list installed command # noqa jinja[spacing] @@ -169,7 +169,7 @@ register: __sap_general_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_general_preconfigure_assert_ignore_errors | d(false) }}" @@ -183,7 +183,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_general_preconfigure_assert_ignore_errors | d(false) }}" @@ -280,20 +280,20 @@ - name: "Assert - Set needs-restarting command in case of RHEL 7" ansible.builtin.set_fact: __sap_general_preconfigure_fact_needs_restarting_command_assert: "needs-restarting -r" - when: ansible_distribution_major_version == '7' + when: 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_general_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_general_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_distribution_version == '8.0' + when: ansible_facts['distribution_version'] == '8.0' - name: Assert - Display the command for checking a reboot requirement ansible.builtin.debug: diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-dns-name-resolution.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-dns-name-resolution.yml index c9465aa5d..0c6109a74 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-dns-name-resolution.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-dns-name-resolution.yml @@ -3,7 +3,7 @@ - name: Assert that the DNS domain is set ansible.builtin.assert: - that: not( (ansible_domain is undefined) or (ansible_domain is none) or (ansible_domain | trim == '') ) + that: not( (ansible_facts['domain'] is undefined) or (ansible_facts['domain'] is none) or (ansible_facts['domain'] | trim == '') ) fail_msg: "FAIL: The DNS domain is not configured! So variable 'sap_general_preconfigure_domain' needs to be configured!" success_msg: "PASS: The DNS domain is configured." # ignore_errors: "{{ sap_general_preconfigure_assert_ignore_errors | d(false) }}" @@ -29,11 +29,11 @@ changed_when: false when: "'bind-utils' in ansible_facts.packages" -- name: Assert that ansible_default_ipv4.address is set +- name: Assert that ansible_facts['default_ipv4'].address is set ansible.builtin.assert: - that: not( (ansible_default_ipv4.address is undefined) or (ansible_default_ipv4.address is none) or (ansible_default_ipv4.address | trim == '') ) - fail_msg: "FAIL: The variable 'ansible_default_ipv4.address' is not defined!" - success_msg: "PASS: The variable 'ansible_default_ipv4.address' is defined." + that: not( (ansible_facts['default_ipv4'].address is undefined) or (ansible_facts['default_ipv4'].address is none) or (ansible_facts['default_ipv4'].address | trim == '') ) + fail_msg: "FAIL: The variable 'ansible_facts['default_ipv4'].address' is not defined!" + success_msg: "PASS: The variable 'ansible_facts['default_ipv4'].address' is defined." ignore_errors: "{{ sap_general_preconfigure_assert_ignore_errors | d(false) }}" - name: Assert that sap_general_preconfigure_ip is set diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-selinux.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-selinux.yml index 0b924d447..c23b0e5ad 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-selinux.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/assert-selinux.yml @@ -62,7 +62,7 @@ name: policycoreutils-python-utils when: - sap_general_preconfigure_modify_selinux_labels - - ansible_distribution_major_version != '7' + - ansible_facts['distribution_major_version'] != '7' - name: Check if the directory '/usr/sap' exists ansible.builtin.stat: diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-selinux.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-selinux.yml index 931d1a943..6d4337b3f 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-selinux.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-selinux.yml @@ -94,8 +94,8 @@ - name: Set or unset SELinux kernel parameter, RHEL >= 8 when: - - ansible_os_family == 'RedHat' - - ansible_distribution_major_version | int >= 8 + - ansible_facts['os_family'] == 'RedHat' + - ansible_facts['distribution_major_version'] | int >= 8 block: - name: SELinux - Examine grub entries diff --git a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-systemd-tmpfiles.yml b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-systemd-tmpfiles.yml index 9ae623525..d773449d2 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-systemd-tmpfiles.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/generic/configure-systemd-tmpfiles.yml @@ -9,7 +9,7 @@ group: root mode: '0644' backup: true - when: ansible_distribution_major_version | int <= 8 + when: ansible_facts['distribution_major_version'] | int <= 8 - name: Copy file /etc/tmpfiles.d/sap.conf, RHEL 9 and later ansible.builtin.copy: @@ -19,4 +19,4 @@ group: root mode: '0644' backup: true - when: ansible_distribution_major_version | int >= 9 + when: ansible_facts['distribution_major_version'] | int >= 9 diff --git a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml index 3e96620b0..4295c93d3 100644 --- a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml +++ b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml @@ -34,7 +34,7 @@ __sap_general_preconfigure_req_ha_repos | list }}" when: - sap_general_preconfigure_req_repos is undefined - - ansible_architecture != 's390x' + - ansible_facts['architecture'] != 's390x' - name: Set final list of repos, s390x, auto ansible.builtin.set_fact: @@ -44,7 +44,7 @@ __sap_general_preconfigure_req_ha_repos | list }}" when: - sap_general_preconfigure_req_repos is undefined - - ansible_architecture == 's390x' + - ansible_facts['architecture'] == 's390x' - name: Set final list of repos, manual ansible.builtin.set_fact: @@ -106,21 +106,21 @@ msg: "The RHEL minor release lock is set correctly to '{{ __sap_general_preconfigure_register_subscription_manager_release.stdout }}'." when: - sap_general_preconfigure_set_minor_release - - __sap_general_preconfigure_register_subscription_manager_release.stdout == ansible_distribution_version + - __sap_general_preconfigure_register_subscription_manager_release.stdout == ansible_facts['distribution_version'] # Reason for noqa: Finding out if the minor release has already been set would require one more task. - name: Set the minor RHEL release # noqa no-changed-when - ansible.builtin.command: subscription-manager release --set="{{ ansible_distribution_version }}" + ansible.builtin.command: subscription-manager release --set="{{ ansible_facts['distribution_version'] }}" when: - sap_general_preconfigure_set_minor_release - - __sap_general_preconfigure_register_subscription_manager_release.stdout != ansible_distribution_version + - __sap_general_preconfigure_register_subscription_manager_release.stdout != ansible_facts['distribution_version'] tags: molecule-idempotence-notest - name: Ensure that the required package groups are installed, RHEL except 8.1 ansible.builtin.package: name: "{{ sap_general_preconfigure_packagegroups }}" state: present - when: ansible_distribution_version != '8.1' + when: ansible_facts['distribution_version'] != '8.1' # Note: We do not want package updates, see also Red Hat bug 1983749. # Because the installation of an environment or package group is not guaranteed to avoid package updates, @@ -130,7 +130,7 @@ - name: Ensure that the required package groups are installed, RHEL 8.1 # noqa command-instead-of-module no-changed-when ansible.builtin.command: "yum install {{ sap_general_preconfigure_packagegroups | join(' ') }} --nobest --exclude=kernel* -y" register: __sap_general_preconfigure_register_yum_group_install - when: ansible_distribution_version == '8.1' + when: ansible_facts['distribution_version'] == '8.1' tags: molecule-idempotence-notest # possible replacement once we no longer need Ansible 2.9 compatibility: @@ -140,7 +140,7 @@ # state: present # nobest: true # supported from Ansible 2.11 # register: __sap_general_preconfigure_register_yum_group_install -# when: ansible_distribution_major_version == '8' or ansible_distribution_major_version == '9' +# when: ansible_facts['distribution_major_version'] == '8' or ansible_facts['distribution_major_version'] == '9' - name: Ensure that the required packages are installed ansible.builtin.package: @@ -153,7 +153,7 @@ state: present disable_gpg_check: True when: - - ansible_architecture == "ppc64le" + - ansible_facts['architecture'] == "ppc64le" - sap_general_preconfigure_install_ibm_power_tools | d(true) - sap_general_preconfigure_add_ibm_power_repo | d(true) @@ -161,7 +161,7 @@ ansible.builtin.shell: LESS=+q /opt/ibm/lop/configure <<<'y' changed_when: true when: - - ansible_architecture == "ppc64le" + - ansible_facts['architecture'] == "ppc64le" - sap_general_preconfigure_install_ibm_power_tools | d(true) - sap_general_preconfigure_add_ibm_power_repo | d(true) @@ -171,7 +171,7 @@ state: latest name: "{{ __sap_general_preconfigure_required_ppc64le }}" when: - - ansible_architecture == "ppc64le" + - ansible_facts['architecture'] == "ppc64le" - sap_general_preconfigure_install_ibm_power_tools | d(true) - name: Ensure that the minimum required package versions are installed @@ -243,20 +243,20 @@ - name: "Set needs-restarting command in case of RHEL 7" ansible.builtin.set_fact: __sap_general_preconfigure_fact_needs_restarting_command: "needs-restarting -r" - when: ansible_distribution_major_version == '7' + when: 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_general_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_general_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' + when: ansible_facts['distribution_version'] == '8.0' - name: Display the command for checking a reboot requirement ansible.builtin.debug: diff --git a/roles/sap_general_preconfigure/tasks/SLES/generic/saptune_install.yml b/roles/sap_general_preconfigure/tasks/SLES/generic/saptune_install.yml index d7e88ae35..212531086 100644 --- a/roles/sap_general_preconfigure/tasks/SLES/generic/saptune_install.yml +++ b/roles/sap_general_preconfigure/tasks/SLES/generic/saptune_install.yml @@ -11,10 +11,10 @@ - name: Set fact if baseproduct contains SLES without SLES_SAP ansible.builtin.set_fact: __sap_general_preconfigure_use_saptune: false - when: - - '"SLES_SAP" not in __sap_general_preconfigure_register_baseproduct.stat.lnk_target' - - '"SLES" in __sap_general_preconfigure_register_baseproduct.stat.lnk_target - and ansible_distribution_major_version | int < 16' + when: >- + "SLES_SAP" not in __sap_general_preconfigure_register_baseproduct.stat.lnk_target + and ("SLES" in __sap_general_preconfigure_register_baseproduct.stat.lnk_target + and ansible_facts['distribution_major_version'] | int < 16) - name: Block to ensure saptune is installed diff --git a/roles/sap_general_preconfigure/tasks/SLES/generic/saptune_takeover.yml b/roles/sap_general_preconfigure/tasks/SLES/generic/saptune_takeover.yml index 142592732..8022fe965 100644 --- a/roles/sap_general_preconfigure/tasks/SLES/generic/saptune_takeover.yml +++ b/roles/sap_general_preconfigure/tasks/SLES/generic/saptune_takeover.yml @@ -16,7 +16,7 @@ - __sap_general_preconfigure_use_saptune - __sap_general_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_general_preconfigure/tasks/main.yml b/roles/sap_general_preconfigure/tasks/main.yml index 55dfe6231..a0d404e8a 100644 --- a/roles/sap_general_preconfigure/tasks/main.yml +++ b/roles/sap_general_preconfigure/tasks/main.yml @@ -18,16 +18,16 @@ loop: "{{ __var_files }}" vars: __vars_file: "{{ role_path }}/vars/{{ item }}" - __distribution_major: "{{ ansible_distribution ~ '_' ~ ansible_distribution_major_version }}" - __distribution_minor: "{{ ansible_distribution ~ '_' ~ ansible_distribution_version }}" + __distribution_major: "{{ ansible_facts['distribution'] ~ '_' ~ ansible_facts['distribution_major_version'] }}" + __distribution_minor: "{{ ansible_facts['distribution'] ~ '_' ~ ansible_facts['distribution_version'] }}" # Enables loading of shared vars between SLES and SLES_SAP - __distribution_major_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_major_version }}" - __distribution_minor_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_version }}" + __distribution_major_split: "{{ ansible_facts['distribution'].split('_')[0] ~ '_' ~ ansible_facts['distribution_major_version'] }}" + __distribution_minor_split: "{{ ansible_facts['distribution'].split('_')[0] ~ '_' ~ ansible_facts['distribution_version'] }}" __var_files: >- {{ [ - 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_major_split ~ '.yml') if __distribution_major_split != __distribution_major else None, (__distribution_minor_split ~ '.yml') if __distribution_minor_split != __distribution_minor else None, __distribution_major ~ '.yml', @@ -113,9 +113,9 @@ tags: sap_general_preconfigure_installation when: sap_general_preconfigure_config_all | d(true) or sap_general_preconfigure_installation | d(false) with_first_found: - - '{{ ansible_distribution.split("_")[0] }}' - - '{{ ansible_distribution }}' - - '{{ ansible_os_family }}.yml' + - "{{ ansible_facts['distribution'].split('_')[0] }}" + - "{{ ansible_facts['distribution'] }}" + - "{{ ansible_facts['os_family'] }}.yml" tags: - sap_general_preconfigure_installation @@ -126,9 +126,9 @@ tags: sap_general_preconfigure_configuration when: sap_general_preconfigure_config_all | d(true) or sap_general_preconfigure_configuration | d(false) with_first_found: - - '{{ ansible_distribution.split("_")[0] }}' - - '{{ ansible_distribution }}' - - '{{ ansible_os_family }}.yml' + - "{{ ansible_facts['distribution'].split('_')[0] }}" + - "{{ ansible_facts['distribution'] }}" + - "{{ ansible_facts['os_family'] }}.yml" tags: - always diff --git a/roles/sap_general_preconfigure/tasks/sapnote/0941735.yml b/roles/sap_general_preconfigure/tasks/sapnote/0941735.yml index 07a716c03..bbad1f336 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/0941735.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/0941735.yml @@ -6,8 +6,8 @@ ansible.builtin.debug: msg: "SAP note {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^0941735$') | first).number }} (version {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^0941735$') | first).version }}): Configure tmpfs; - memtotal_mb = {{ ansible_memtotal_mb }}; - swaptotal_mb = {{ ansible_swaptotal_mb }}; + memtotal_mb = {{ ansible_facts['memtotal_mb'] }}; + swaptotal_mb = {{ ansible_facts['swaptotal_mb'] }}; sap_general_preconfigure_size_of_tmpfs_gb = {{ sap_general_preconfigure_size_of_tmpfs_gb }}" tags: - always diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-assert-tmpfs.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-assert-tmpfs.yml index 591f2ee62..ce364c182 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-assert-tmpfs.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-assert-tmpfs.yml @@ -4,8 +4,8 @@ - name: Assert 2772999-7 ansible.builtin.debug: msg: "SAP note 2772999 Step 7: Configure tmpfs; - memtotal_mb = {{ ansible_memtotal_mb }}; - swaptotal_mb = {{ ansible_swaptotal_mb }}; + memtotal_mb = {{ ansible_facts['memtotal_mb'] }}; + swaptotal_mb = {{ ansible_facts['swaptotal_mb'] }}; sap_general_preconfigure_size_of_tmpfs_gb = {{ sap_general_preconfigure_size_of_tmpfs_gb }}" tags: - sap_general_preconfigure_configure_tmpfs diff --git a/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-configure-tmpfs.yml b/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-configure-tmpfs.yml index fb1df10fa..f207aff10 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-configure-tmpfs.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/2772999/07-configure-tmpfs.yml @@ -4,8 +4,8 @@ - name: Configure 2772999-7 ansible.builtin.debug: msg: "SAP note 2772999 Step 7: Configure tmpfs; - memtotal_mb = {{ ansible_memtotal_mb }}; - swaptotal_mb = {{ ansible_swaptotal_mb }}; + memtotal_mb = {{ ansible_facts['memtotal_mb'] }}; + swaptotal_mb = {{ ansible_facts['swaptotal_mb'] }}; sap_general_preconfigure_size_of_tmpfs_gb = {{ sap_general_preconfigure_size_of_tmpfs_gb }}" tags: - sap_general_preconfigure_configure_tmpfs diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-assert-tmpfs.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-assert-tmpfs.yml index f64c621f6..dfae4c933 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-assert-tmpfs.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-assert-tmpfs.yml @@ -4,8 +4,8 @@ - name: Assert 3108316-7 ansible.builtin.debug: msg: "SAP note 3108316 Step 7: Configure tmpfs; - memtotal_mb = {{ ansible_memtotal_mb }}; - swaptotal_mb = {{ ansible_swaptotal_mb }}; + memtotal_mb = {{ ansible_facts['memtotal_mb'] }}; + swaptotal_mb = {{ ansible_facts['swaptotal_mb'] }}; sap_general_preconfigure_size_of_tmpfs_gb = {{ sap_general_preconfigure_size_of_tmpfs_gb }}" tags: - sap_general_preconfigure_configure_tmpfs diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-configure-tmpfs.yml b/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-configure-tmpfs.yml index 44f130211..43e095fa6 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-configure-tmpfs.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3108316/07-configure-tmpfs.yml @@ -4,8 +4,8 @@ - name: Configure 3108316-7 ansible.builtin.debug: msg: "SAP note 3108316 Step 7: Configure tmpfs; - memtotal_mb = {{ ansible_memtotal_mb }}; - swaptotal_mb = {{ ansible_swaptotal_mb }}; + memtotal_mb = {{ ansible_facts['memtotal_mb'] }}; + swaptotal_mb = {{ ansible_facts['swaptotal_mb'] }}; sap_general_preconfigure_size_of_tmpfs_gb = {{ sap_general_preconfigure_size_of_tmpfs_gb }}" tags: - sap_general_preconfigure_configure_tmpfs diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3562909/07-assert-tmpfs.yml b/roles/sap_general_preconfigure/tasks/sapnote/3562909/07-assert-tmpfs.yml index 48548d2e6..74475fd55 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3562909/07-assert-tmpfs.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3562909/07-assert-tmpfs.yml @@ -4,8 +4,8 @@ - name: Assert 3562909-7 ansible.builtin.debug: msg: "SAP note 3562909 Step 7: Configure tmpfs; - memtotal_mb = {{ ansible_memtotal_mb }}; - swaptotal_mb = {{ ansible_swaptotal_mb }}; + memtotal_mb = {{ ansible_facts['memtotal_mb'] }}; + swaptotal_mb = {{ ansible_facts['swaptotal_mb'] }}; sap_general_preconfigure_size_of_tmpfs_gb = {{ sap_general_preconfigure_size_of_tmpfs_gb }}" tags: - sap_general_preconfigure_configure_tmpfs diff --git a/roles/sap_general_preconfigure/tasks/sapnote/3562909/07-configure-tmpfs.yml b/roles/sap_general_preconfigure/tasks/sapnote/3562909/07-configure-tmpfs.yml index 99c61abfb..9a873661c 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/3562909/07-configure-tmpfs.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/3562909/07-configure-tmpfs.yml @@ -4,8 +4,8 @@ - name: Configure 3562909-7 ansible.builtin.debug: msg: "SAP note 3562909 Step 7: Configure tmpfs; - memtotal_mb = {{ ansible_memtotal_mb }}; - swaptotal_mb = {{ ansible_swaptotal_mb }}; + memtotal_mb = {{ ansible_facts['memtotal_mb'] }}; + swaptotal_mb = {{ ansible_facts['swaptotal_mb'] }}; sap_general_preconfigure_size_of_tmpfs_gb = {{ sap_general_preconfigure_size_of_tmpfs_gb }}" tags: - sap_general_preconfigure_configure_tmpfs diff --git a/roles/sap_general_preconfigure/tasks/sapnote/assert-0941735.yml b/roles/sap_general_preconfigure/tasks/sapnote/assert-0941735.yml index 8c8a501a9..b4087c594 100644 --- a/roles/sap_general_preconfigure/tasks/sapnote/assert-0941735.yml +++ b/roles/sap_general_preconfigure/tasks/sapnote/assert-0941735.yml @@ -6,8 +6,8 @@ ansible.builtin.debug: msg: "SAP note {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^0941735$') | first).number }} (version {{ (__sap_general_preconfigure_sapnotes_versions | selectattr('number', 'match', '^0941735$') | first).version }}): Configure tmpfs; - memtotal_mb = {{ ansible_memtotal_mb }}; - swaptotal_mb = {{ ansible_swaptotal_mb }}; + memtotal_mb = {{ ansible_facts['memtotal_mb'] }}; + swaptotal_mb = {{ ansible_facts['swaptotal_mb'] }}; sap_general_preconfigure_size_of_tmpfs_gb = {{ sap_general_preconfigure_size_of_tmpfs_gb }}" tags: - always diff --git a/roles/sap_general_preconfigure/vars/RedHat_10.yml b/roles/sap_general_preconfigure/vars/RedHat_10.yml index 435413661..9729aa9f8 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_10.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_10.yml @@ -12,7 +12,7 @@ __sap_general_preconfigure_max_repo_type_x86_64: 'e4s' __sap_general_preconfigure_max_repo_type_ppc64le: 'e4s' __sap_general_preconfigure_max_repo_type_s390x: 'eus' -__sap_general_preconfigure_max_repo_type: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_' + ansible_architecture) }}" +__sap_general_preconfigure_max_repo_type: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_' + ansible_facts['architecture']) }}" # RHEL 10 minor releases maximum repo support duration __sap_general_preconfigure_max_repo_type_string_10_0: '{{ __sap_general_preconfigure_max_repo_type }}-' @@ -27,17 +27,17 @@ __sap_general_preconfigure_max_repo_type_string_10_8: '{{ __sap_general_preconfi __sap_general_preconfigure_max_repo_type_string_10_9: '' __sap_general_preconfigure_max_repo_type_string_10_10: '' -__sap_general_preconfigure_max_repo_type_string: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_string_' + ansible_distribution_version | replace(\".\", \"_\")) }}" +__sap_general_preconfigure_max_repo_type_string: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_string_' + ansible_facts['distribution_version'] | replace(\".\", \"_\")) }}" __sap_general_preconfigure_req_os_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-baseos-{{ __sap_general_preconfigure_max_repo_type_string }}rpms - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-appstream-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-baseos-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-appstream-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_netweaver_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-sap-netweaver-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-sap-netweaver-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_hana_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-sap-solutions-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-sap-solutions-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_ha_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-highavailability-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_envgroups: - "server-product-environment" @@ -51,7 +51,7 @@ __sap_general_preconfigure_packagegroups_ppc64le: __sap_general_preconfigure_packagegroups_s390x: - "@server" -__sap_general_preconfigure_packagegroups: "{{ lookup('vars', '__sap_general_preconfigure_packagegroups_' + ansible_architecture) }}" +__sap_general_preconfigure_packagegroups: "{{ lookup('vars', '__sap_general_preconfigure_packagegroups_' + ansible_facts['architecture']) }}" __sap_general_preconfigure_packages_x86_64: - uuidd @@ -101,7 +101,7 @@ __sap_general_preconfigure_packages_s390x: - langpacks-en - glibc-langpack-en -__sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_architecture) }}" +__sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_facts['architecture']) }}" __sap_general_preconfigure_required_ppc64le: - ibm-power-managed-rhel10 diff --git a/roles/sap_general_preconfigure/vars/RedHat_7.yml b/roles/sap_general_preconfigure/vars/RedHat_7.yml index 5478a445f..e9309bf0c 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_7.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_7.yml @@ -21,8 +21,8 @@ __sap_general_preconfigure_rhel_7_ha_arch_string_ppc64le: 'server-for-power-le' __sap_general_preconfigure_rhel_7_ha_arch_string_ppc64: '{{ __sap_general_preconfigure_rhel_7_arch_string_ppc64 }}' __sap_general_preconfigure_rhel_7_ha_arch_string_s390x: '{{ __sap_general_preconfigure_rhel_7_arch_string_s390x }}' -__sap_general_preconfigure_rhel_7_arch_string: "{{ lookup('vars', '__sap_general_preconfigure_rhel_7_arch_string_' + ansible_architecture) }}" -__sap_general_preconfigure_rhel_7_ha_arch_string: "{{ lookup('vars', '__sap_general_preconfigure_rhel_7_ha_arch_string_' + ansible_architecture) }}" +__sap_general_preconfigure_rhel_7_arch_string: "{{ lookup('vars', '__sap_general_preconfigure_rhel_7_arch_string_' + ansible_facts['architecture']) }}" +__sap_general_preconfigure_rhel_7_ha_arch_string: "{{ lookup('vars', '__sap_general_preconfigure_rhel_7_ha_arch_string_' + ansible_facts['architecture']) }}" __sap_general_preconfigure_max_repo_type_x86_64: 'e4s-' __sap_general_preconfigure_max_repo_type_ppc64le: 'e4s-' @@ -34,8 +34,8 @@ __sap_general_preconfigure_max_repo_type_ha_ppc64le: '{{ __sap_general_preconfig __sap_general_preconfigure_max_repo_type_ha_ppc64: '{{ __sap_general_preconfigure_max_repo_type_ppc64 }}' __sap_general_preconfigure_max_repo_type_ha_s390x: '' -__sap_general_preconfigure_max_repo_type: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_' + ansible_architecture) }}" -__sap_general_preconfigure_max_repo_type_ha: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_ha_' + ansible_architecture) }}" +__sap_general_preconfigure_max_repo_type: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_' + ansible_facts['architecture']) }}" +__sap_general_preconfigure_max_repo_type_ha: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_ha_' + ansible_facts['architecture']) }}" # RHEL 7 minor releases maximum repo support duration __sap_general_preconfigure_max_repo_type_string_7_6: '{{ __sap_general_preconfigure_max_repo_type }}' @@ -47,17 +47,17 @@ __sap_general_preconfigure_max_repo_type_ha_string_7_7: '{{ __sap_general_precon __sap_general_preconfigure_max_repo_type_ha_string_7_8: '' __sap_general_preconfigure_max_repo_type_ha_string_7_9: '' -__sap_general_preconfigure_max_repo_type_string: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_string_' + ansible_distribution_version | replace(\".\", \"_\")) }}" -__sap_general_preconfigure_max_repo_type_ha_string: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_ha_string_' + ansible_distribution_version | replace(\".\", \"_\")) }}" +__sap_general_preconfigure_max_repo_type_string: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_string_' + ansible_facts['distribution_version'] | replace(\".\", \"_\")) }}" +__sap_general_preconfigure_max_repo_type_ha_string: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_ha_string_' + ansible_facts['distribution_version'] | replace(\".\", \"_\")) }}" __sap_general_preconfigure_req_os_repos: - - rhel-{{ ansible_distribution_major_version }}-{{ __sap_general_preconfigure_rhel_7_arch_string }}-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-{{ __sap_general_preconfigure_rhel_7_arch_string }}-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_netweaver_repos: - - rhel-sap-for-rhel-{{ ansible_distribution_major_version }}-{{ __sap_general_preconfigure_rhel_7_arch_string }}-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-sap-for-rhel-{{ ansible_facts['distribution_major_version'] }}-{{ __sap_general_preconfigure_rhel_7_arch_string }}-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_hana_repos: - - rhel-sap-hana-for-rhel-{{ ansible_distribution_major_version }}-{{ __sap_general_preconfigure_rhel_7_arch_string }}-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-sap-hana-for-rhel-{{ ansible_facts['distribution_major_version'] }}-{{ __sap_general_preconfigure_rhel_7_arch_string }}-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_ha_repos: - - rhel-ha-for-rhel-{{ ansible_distribution_major_version }}-{{ __sap_general_preconfigure_rhel_7_ha_arch_string }}-{{ __sap_general_preconfigure_max_repo_type_ha_string }}rpms + - rhel-ha-for-rhel-{{ ansible_facts['distribution_major_version'] }}-{{ __sap_general_preconfigure_rhel_7_ha_arch_string }}-{{ __sap_general_preconfigure_max_repo_type_ha_string }}rpms __sap_general_preconfigure_envgroups: "" @@ -83,7 +83,7 @@ __sap_general_preconfigure_packagegroups_s390x: - "@network-file-system-client" - "@performance" -__sap_general_preconfigure_packagegroups: "{{ lookup('vars', '__sap_general_preconfigure_packagegroups_' + ansible_architecture) }}" +__sap_general_preconfigure_packagegroups: "{{ lookup('vars', '__sap_general_preconfigure_packagegroups_' + ansible_facts['architecture']) }}" __sap_general_preconfigure_packages_x86_64: - uuidd @@ -116,7 +116,7 @@ __sap_general_preconfigure_packages_s390x: - tcsh - psmisc -__sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_architecture) }}" +__sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_facts['architecture']) }}" # As per https://www14.software.ibm.com/support/customercare/sas/f/lopdiags/home.html : __sap_general_preconfigure_required_ppc64le: @@ -167,7 +167,7 @@ __sap_general_preconfigure_min_packages_7_8: __sap_general_preconfigure_min_packages_7_9: -__sap_general_preconfigure_min_pkgs: "{{ lookup('vars', '__sap_general_preconfigure_min_packages_' + ansible_distribution_version | replace(\".\", \"_\")) }}" +__sap_general_preconfigure_min_pkgs: "{{ lookup('vars', '__sap_general_preconfigure_min_packages_' + ansible_facts['distribution_version'] | replace(\".\", \"_\")) }}" # Note: The value for vm.max_map_count of 2147483647 (previously 2000000) # is set according to SAP note 900929. diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.0.yml b/roles/sap_general_preconfigure/vars/RedHat_8.0.yml index d0f8fe031..1748d92d3 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.0.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.0.yml @@ -12,20 +12,20 @@ __sap_general_preconfigure_max_repo_type_x86_64: 'e4s' __sap_general_preconfigure_max_repo_type_ppc64le: 'e4s' __sap_general_preconfigure_max_repo_type_s390x: 'eus' -__sap_general_preconfigure_max_repo_type: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_' + ansible_architecture) }}" +__sap_general_preconfigure_max_repo_type: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_' + ansible_facts['architecture']) }}" # RHEL 8 minor releases maximum repo support duration __sap_general_preconfigure_max_repo_type_string: '{{ __sap_general_preconfigure_max_repo_type }}-' __sap_general_preconfigure_req_os_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-baseos-{{ __sap_general_preconfigure_max_repo_type_string }}rpms - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-appstream-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-baseos-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-appstream-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_netweaver_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-sap-netweaver-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-sap-netweaver-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_hana_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-sap-solutions-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-sap-solutions-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_ha_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-highavailability-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_envgroups: - "server-product-environment" @@ -39,7 +39,7 @@ __sap_general_preconfigure_packagegroups_ppc64le: __sap_general_preconfigure_packagegroups_s390x: - "@server" -__sap_general_preconfigure_packagegroups: "{{ lookup('vars', '__sap_general_preconfigure_packagegroups_' + ansible_architecture) }}" +__sap_general_preconfigure_packagegroups: "{{ lookup('vars', '__sap_general_preconfigure_packagegroups_' + ansible_facts['architecture']) }}" __sap_general_preconfigure_packages: - uuidd diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.1.yml b/roles/sap_general_preconfigure/vars/RedHat_8.1.yml index 375b7e05f..0d50aab1c 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.1.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.1.yml @@ -12,20 +12,20 @@ __sap_general_preconfigure_max_repo_type_x86_64: 'e4s' __sap_general_preconfigure_max_repo_type_ppc64le: 'e4s' __sap_general_preconfigure_max_repo_type_s390x: 'eus' -__sap_general_preconfigure_max_repo_type: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_' + ansible_architecture) }}" +__sap_general_preconfigure_max_repo_type: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_' + ansible_facts['architecture']) }}" # RHEL 8 minor releases maximum repo support duration __sap_general_preconfigure_max_repo_type_string: '{{ __sap_general_preconfigure_max_repo_type }}-' __sap_general_preconfigure_req_os_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-baseos-{{ __sap_general_preconfigure_max_repo_type_string }}rpms - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-appstream-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-baseos-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-appstream-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_netweaver_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-sap-netweaver-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-sap-netweaver-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_hana_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-sap-solutions-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-sap-solutions-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_ha_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-highavailability-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_envgroups: - "server-product-environment" @@ -39,7 +39,7 @@ __sap_general_preconfigure_packagegroups_ppc64le: __sap_general_preconfigure_packagegroups_s390x: - "@server" -__sap_general_preconfigure_packagegroups: "{{ lookup('vars', '__sap_general_preconfigure_packagegroups_' + ansible_architecture) }}" +__sap_general_preconfigure_packagegroups: "{{ lookup('vars', '__sap_general_preconfigure_packagegroups_' + ansible_facts['architecture']) }}" __sap_general_preconfigure_packages_x86_64: - uuidd @@ -78,7 +78,7 @@ __sap_general_preconfigure_packages_s390x: - langpacks-en - glibc-langpack-en -__sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_architecture) }}" +__sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_facts['architecture']) }}" __sap_general_preconfigure_required_ppc64le: - ibm-power-managed-rhel8 diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.2.yml b/roles/sap_general_preconfigure/vars/RedHat_8.2.yml index bd26d320e..3e43d8eb9 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.2.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.2.yml @@ -12,20 +12,20 @@ __sap_general_preconfigure_max_repo_type_x86_64: 'e4s' __sap_general_preconfigure_max_repo_type_ppc64le: 'e4s' __sap_general_preconfigure_max_repo_type_s390x: 'eus' -__sap_general_preconfigure_max_repo_type: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_' + ansible_architecture) }}" +__sap_general_preconfigure_max_repo_type: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_' + ansible_facts['architecture']) }}" # RHEL 8 minor releases maximum repo support duration __sap_general_preconfigure_max_repo_type_string: '{{ __sap_general_preconfigure_max_repo_type }}-' __sap_general_preconfigure_req_os_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-baseos-{{ __sap_general_preconfigure_max_repo_type_string }}rpms - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-appstream-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-baseos-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-appstream-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_netweaver_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-sap-netweaver-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-sap-netweaver-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_hana_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-sap-solutions-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-sap-solutions-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_ha_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-highavailability-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_envgroups: - "server-product-environment" @@ -39,7 +39,7 @@ __sap_general_preconfigure_packagegroups_ppc64le: __sap_general_preconfigure_packagegroups_s390x: - "@server" -__sap_general_preconfigure_packagegroups: "{{ lookup('vars', '__sap_general_preconfigure_packagegroups_' + ansible_architecture) }}" +__sap_general_preconfigure_packagegroups: "{{ lookup('vars', '__sap_general_preconfigure_packagegroups_' + ansible_facts['architecture']) }}" __sap_general_preconfigure_packages_x86_64: - uuidd @@ -78,7 +78,7 @@ __sap_general_preconfigure_packages_s390x: - langpacks-en - glibc-langpack-en -__sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_architecture) }}" +__sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_facts['architecture']) }}" __sap_general_preconfigure_required_ppc64le: - ibm-power-managed-rhel8 diff --git a/roles/sap_general_preconfigure/vars/RedHat_8.yml b/roles/sap_general_preconfigure/vars/RedHat_8.yml index 12ee9598d..dc2738aae 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_8.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_8.yml @@ -12,7 +12,7 @@ __sap_general_preconfigure_max_repo_type_x86_64: 'e4s' __sap_general_preconfigure_max_repo_type_ppc64le: 'e4s' __sap_general_preconfigure_max_repo_type_s390x: 'eus' -__sap_general_preconfigure_max_repo_type: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_' + ansible_architecture) }}" +__sap_general_preconfigure_max_repo_type: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_' + ansible_facts['architecture']) }}" # RHEL 8 minor releases maximum repo support duration __sap_general_preconfigure_max_repo_type_string_8_3: '' @@ -24,17 +24,17 @@ __sap_general_preconfigure_max_repo_type_string_8_8: '{{ __sap_general_preconfig __sap_general_preconfigure_max_repo_type_string_8_9: '' __sap_general_preconfigure_max_repo_type_string_8_10: '' -__sap_general_preconfigure_max_repo_type_string: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_string_' + ansible_distribution_version | replace(\".\", \"_\")) }}" +__sap_general_preconfigure_max_repo_type_string: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_string_' + ansible_facts['distribution_version'] | replace(\".\", \"_\")) }}" __sap_general_preconfigure_req_os_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-baseos-{{ __sap_general_preconfigure_max_repo_type_string }}rpms - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-appstream-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-baseos-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-appstream-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_netweaver_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-sap-netweaver-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-sap-netweaver-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_hana_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-sap-solutions-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-sap-solutions-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_ha_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-highavailability-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_envgroups: - "server-product-environment" @@ -48,7 +48,7 @@ __sap_general_preconfigure_packagegroups_ppc64le: __sap_general_preconfigure_packagegroups_s390x: - "@server" -__sap_general_preconfigure_packagegroups: "{{ lookup('vars', '__sap_general_preconfigure_packagegroups_' + ansible_architecture) }}" +__sap_general_preconfigure_packagegroups: "{{ lookup('vars', '__sap_general_preconfigure_packagegroups_' + ansible_facts['architecture']) }}" __sap_general_preconfigure_packages_x86_64: - uuidd @@ -90,7 +90,7 @@ __sap_general_preconfigure_packages_s390x: - langpacks-en - glibc-langpack-en -__sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_architecture) }}" +__sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_facts['architecture']) }}" __sap_general_preconfigure_required_ppc64le: - ibm-power-managed-rhel8 diff --git a/roles/sap_general_preconfigure/vars/RedHat_9.yml b/roles/sap_general_preconfigure/vars/RedHat_9.yml index a25793787..3a66216d5 100644 --- a/roles/sap_general_preconfigure/vars/RedHat_9.yml +++ b/roles/sap_general_preconfigure/vars/RedHat_9.yml @@ -12,7 +12,7 @@ __sap_general_preconfigure_max_repo_type_x86_64: 'e4s' __sap_general_preconfigure_max_repo_type_ppc64le: 'e4s' __sap_general_preconfigure_max_repo_type_s390x: 'eus' -__sap_general_preconfigure_max_repo_type: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_' + ansible_architecture) }}" +__sap_general_preconfigure_max_repo_type: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_' + ansible_facts['architecture']) }}" # RHEL 9 minor releases maximum repo support duration __sap_general_preconfigure_max_repo_type_string_9_0: '{{ __sap_general_preconfigure_max_repo_type }}-' @@ -27,17 +27,17 @@ __sap_general_preconfigure_max_repo_type_string_9_8: '{{ __sap_general_preconfig __sap_general_preconfigure_max_repo_type_string_9_9: '' __sap_general_preconfigure_max_repo_type_string_9_10: '' -__sap_general_preconfigure_max_repo_type_string: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_string_' + ansible_distribution_version | replace(\".\", \"_\")) }}" +__sap_general_preconfigure_max_repo_type_string: "{{ lookup('vars', '__sap_general_preconfigure_max_repo_type_string_' + ansible_facts['distribution_version'] | replace(\".\", \"_\")) }}" __sap_general_preconfigure_req_os_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-baseos-{{ __sap_general_preconfigure_max_repo_type_string }}rpms - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-appstream-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-baseos-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-appstream-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_netweaver_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-sap-netweaver-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-sap-netweaver-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_hana_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-sap-solutions-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-sap-solutions-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_req_ha_repos: - - rhel-{{ ansible_distribution_major_version }}-for-{{ ansible_architecture }}-highavailability-{{ __sap_general_preconfigure_max_repo_type_string }}rpms + - rhel-{{ ansible_facts['distribution_major_version'] }}-for-{{ ansible_facts['architecture'] }}-highavailability-{{ __sap_general_preconfigure_max_repo_type_string }}rpms __sap_general_preconfigure_envgroups: - "server-product-environment" @@ -51,7 +51,7 @@ __sap_general_preconfigure_packagegroups_ppc64le: __sap_general_preconfigure_packagegroups_s390x: - "@server" -__sap_general_preconfigure_packagegroups: "{{ lookup('vars', '__sap_general_preconfigure_packagegroups_' + ansible_architecture) }}" +__sap_general_preconfigure_packagegroups: "{{ lookup('vars', '__sap_general_preconfigure_packagegroups_' + ansible_facts['architecture']) }}" __sap_general_preconfigure_packages_x86_64: - uuidd @@ -104,7 +104,7 @@ __sap_general_preconfigure_packages_s390x: - langpacks-en - glibc-langpack-en -__sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_architecture) }}" +__sap_general_preconfigure_packages: "{{ lookup('vars', '__sap_general_preconfigure_packages_' + ansible_facts['architecture']) }}" __sap_general_preconfigure_required_ppc64le: - ibm-power-managed-rhel9 diff --git a/roles/sap_hana_install/tasks/pre_tasks/check_filesystems.yml b/roles/sap_hana_install/tasks/pre_tasks/check_filesystems.yml index b912bd80b..b805f2fa4 100644 --- a/roles/sap_hana_install/tasks/pre_tasks/check_filesystems.yml +++ b/roles/sap_hana_install/tasks/pre_tasks/check_filesystems.yml @@ -14,8 +14,8 @@ - name: SAP HANA - Install - Pre-Tasks - Set fact with mount details of {{ sap_hana_install_shared_path }} ansible.builtin.set_fact: __sap_hana_install_fact_mount_hana_shared: - "{{ ansible_mounts | selectattr('mount', 'equalto', sap_hana_install_shared_path) | list | first }}" - when: ansible_mounts | selectattr('mount', 'equalto', sap_hana_install_shared_path) | list | length > 0 + "{{ ansible_facts['mounts'] | selectattr('mount', 'equalto', sap_hana_install_shared_path) | list | first }}" + when: ansible_facts['mounts'] | selectattr('mount', 'equalto', sap_hana_install_shared_path) | list | length > 0 - name: SAP HANA - Install - Pre-Tasks - Assert that filesystem is shared - {{ sap_hana_install_shared_path }} ansible.builtin.assert: @@ -56,8 +56,8 @@ - name: SAP HANA - Install - Pre-Tasks - Set fact with mount details of {{ __sap_hana_install_lss_inst_path }} ansible.builtin.set_fact: __sap_hana_install_fact_mount_lss_shared: - "{{ ansible_mounts | selectattr('mount', 'equalto', __sap_hana_install_lss_inst_path) | list | first }}" - when: ansible_mounts | selectattr('mount', 'equalto', __sap_hana_install_lss_inst_path) | list | length > 0 + "{{ ansible_facts['mounts'] | selectattr('mount', 'equalto', __sap_hana_install_lss_inst_path) | list | first }}" + when: ansible_facts['mounts'] | selectattr('mount', 'equalto', __sap_hana_install_lss_inst_path) | list | length > 0 - name: SAP HANA - Install - Pre-Tasks - Assert that filesystem is shared - {{ __sap_hana_install_lss_inst_path }} ansible.builtin.assert: diff --git a/roles/sap_hana_install/templates/sap-nw-input.j2 b/roles/sap_hana_install/templates/sap-nw-input.j2 index 3b79e1691..62721e0e2 100644 --- a/roles/sap_hana_install/templates/sap-nw-input.j2 +++ b/roles/sap_hana_install/templates/sap-nw-input.j2 @@ -4,11 +4,11 @@ # # SAP HANA Instance Parameters -sap_swpm_db_ip: '{{ ansible_default_ipv4.address|default(ansible_all_ipv4_addresses[0]) }}' -sap_swpm_db_fqdn: '{{ ansible_fqdn }}' -sap_swpm_db_host: '{{ ansible_hostname }}' -sap_swpm_db_sid: '{{ sap_hana_install_sid }}' -sap_swpm_db_instance_nr: '{{ sap_hana_install_number }}' +sap_swpm_db_ip: "{{ ansible_facts['default_ipv4'].address|default(ansible_facts['all_ipv4_addresses'][0]) }}" +sap_swpm_db_fqdn: "{{ ansible_facts['fqdn'] }}" +sap_swpm_db_host: "{{ ansible_facts['hostname'] }}" +sap_swpm_db_sid: "{{ sap_hana_install_sid }}" +sap_swpm_db_instance_nr: "{{ sap_hana_install_number }}" # SAP HANA Passwords sap_swpm_db_system_password: '{{ sap_hana_install_db_system_password|d(sap_hana_install_master_password) }}' diff --git a/roles/sap_hana_install/vars/main.yml b/roles/sap_hana_install/vars/main.yml index 1d7eeb00a..b24f3d97b 100644 --- a/roles/sap_hana_install/vars/main.yml +++ b/roles/sap_hana_install/vars/main.yml @@ -8,7 +8,7 @@ __sap_hana_install_sid_prohibited: ['ADD', 'ADM', 'ALL', 'AMD', 'AND', 'ANY', 'A __sap_hana_install_fact_tmp_dirname: '' # This dictionary defines keyword rules to identify SAP binaries compatible with modern Linux distributions supported by SAP HANA. -# Each key is a valid `ansible_architecture` value. +# Each key is a valid "ansible_facts['architecture']" value. # The value is a list of rule sets, where each rule set is a list of keywords. # A file is considered a match if all keywords from any single rule set are found in the `file` command's output. __sap_hana_install_architecture_matrix: @@ -40,7 +40,7 @@ __sap_hana_install_architecture_matrix: - ['aarch64'] # Sets the default host which will run all non-addhosts tasks. -__sap_hana_install_fact_main_host: "{{ ansible_hostname }}" +__sap_hana_install_fact_main_host: "{{ ansible_facts['hostname'] }}" # Sets default value of Scale-Out detection. # Detection for scaleout is based on addhosts string. 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..b68003b42 100644 --- a/roles/sap_hana_preconfigure/tasks/SLES/generic/saptune_install.yml +++ b/roles/sap_hana_preconfigure/tasks/SLES/generic/saptune_install.yml @@ -11,10 +11,10 @@ - name: Set fact if baseproduct contains SLES without SLES_SAP ansible.builtin.set_fact: __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' + when: >- + "SLES_SAP" not in __sap_hana_preconfigure_register_baseproduct.stat.lnk_target + and ("SLES" in __sap_hana_preconfigure_register_baseproduct.stat.lnk_target + and 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 diff --git a/roles/sap_install_media_detect/README.md b/roles/sap_install_media_detect/README.md index ffbc70041..8998ca30d 100644 --- a/roles/sap_install_media_detect/README.md +++ b/roles/sap_install_media_detect/README.md @@ -167,7 +167,7 @@ Based on this setting, the commands for listing and extracting RAR files are bei ### sap_install_media_detect_epel_gpg_key_url - _Type:_ `str` -- _Default:_ `https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}` +- _Default:_ `https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_facts['distribution_major_version'] }}` URL for the EPEL GPG key diff --git a/roles/sap_install_media_detect/defaults/main.yml b/roles/sap_install_media_detect/defaults/main.yml index 29277a7c0..2e8378530 100644 --- a/roles/sap_install_media_detect/defaults/main.yml +++ b/roles/sap_install_media_detect/defaults/main.yml @@ -11,7 +11,7 @@ sap_install_media_detect_rar_package: 'EPEL' #sap_install_media_detect_rar_package: 'linux-rar' # URL for the EPEL GPG key -sap_install_media_detect_epel_gpg_key_url: "https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}" +sap_install_media_detect_epel_gpg_key_url: "https://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_facts['distribution_major_version'] }}" # The EPEL GPG key can be removed with the rpm_key module and the URL for the key, or by using the rpm -e command. # For using the rpm -e command, set this variable to 'false'. diff --git a/roles/sap_install_media_detect/tasks/cleanup/disable-epel-repo.yml b/roles/sap_install_media_detect/tasks/cleanup/disable-epel-repo.yml index f76d70fe1..8067d311c 100644 --- a/roles/sap_install_media_detect/tasks/cleanup/disable-epel-repo.yml +++ b/roles/sap_install_media_detect/tasks/cleanup/disable-epel-repo.yml @@ -4,7 +4,7 @@ # Note: This file is only included from tasks/main.yml if the epel-release package had not been initially detected. - name: SAP Install Media Detect - Cleanup - Get all GPG keys - ansible.builtin.shell: set -o pipefail && rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{SUMMARY}\n' | awk '/gpg/&&/Fedora/{gsub ("\\(epel", "EPEL "); gsub (" \\(", " "); if ($0 ~ /EPEL {{ ansible_distribution_major_version }}/)print}' + ansible.builtin.shell: set -o pipefail && rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{SUMMARY}\n' | awk '/gpg/&&/Fedora/{gsub ("\\(epel", "EPEL "); gsub (" \\(", " "); if ($0 ~ /EPEL {{ ansible_facts['distribution_major_version'] }}/)print}' register: __sap_install_media_detect_register_rpm_q_gpg_pubkeys failed_when: false changed_when: false @@ -30,7 +30,7 @@ - __sap_install_media_detect_register_rpm_q_gpg_pubkeys.stdout_lines | length == 1 - name: SAP Install Media Detect - Cleanup - Get the GPG keys for this OS version after removal, rpm -e - ansible.builtin.shell: set -o pipefail && rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{SUMMARY}\n' | grep 'EPEL ({{ ansible_distribution_major_version }})' + ansible.builtin.shell: set -o pipefail && rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{SUMMARY}\n' | grep 'EPEL ({{ ansible_facts['distribution_major_version'] }})' register: __sap_install_media_detect_register_rpm_q_gpg_pubkeys_after_removal changed_when: false failed_when: false diff --git a/roles/sap_install_media_detect/tasks/main.yml b/roles/sap_install_media_detect/tasks/main.yml index 2e46b9ac5..45717fd0b 100644 --- a/roles/sap_install_media_detect/tasks/main.yml +++ b/roles/sap_install_media_detect/tasks/main.yml @@ -98,7 +98,7 @@ when: - sap_install_media_detect_rar_handling - sap_install_media_detect_rar_package == 'EPEL' - - ansible_os_family == 'RedHat' + - ansible_facts['os_family'] == 'RedHat' - __sap_install_media_detect_register_rpm_q_epel.stdout != 'epel-release' - name: SAP Install Media Detect - Cleanup - Remove sapfile utility diff --git a/roles/sap_install_media_detect/tasks/prepare/enable_rar_handling.yml b/roles/sap_install_media_detect/tasks/prepare/enable_rar_handling.yml index 3746b07c8..0b9fb8942 100644 --- a/roles/sap_install_media_detect/tasks/prepare/enable_rar_handling.yml +++ b/roles/sap_install_media_detect/tasks/prepare/enable_rar_handling.yml @@ -4,7 +4,7 @@ - name: SAP Install Media Detect - Prepare - Install the unar package from EPEL when: - sap_install_media_detect_rar_package == 'EPEL' - - ansible_os_family == 'RedHat' + - ansible_facts['os_family'] == 'RedHat' block: # Reason for noqa: Too much effort for now to examine the output of the yum module for the presence of a package @@ -33,12 +33,12 @@ # - name: SAP Install Media Detect - Prepare - EPEL - Set fact for the EPEL URL # ansible.builtin.set_fact: -# sap_install_media_detect_epel_url: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm" +# sap_install_media_detect_epel_url: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_facts['distribution_major_version'] }}.noarch.rpm" - name: SAP Install Media Detect - Prepare - EPEL - Enable the EPEL repo ansible.builtin.package: # name: "{{ sap_install_media_detect_epel_url }}" - name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm" + name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_facts['distribution_major_version'] }}.noarch.rpm" state: present retries: 10 @@ -60,7 +60,7 @@ - name: SAP Install Media Detect - Prepare - Install the unar package (SLES) when: - - ansible_os_family == 'Suse' + - ansible_facts['os_family'] == 'Suse' block: # Requires SLES Basesystem_Module_* to obtain package diff --git a/roles/sap_maintain_etc_hosts/README.md b/roles/sap_maintain_etc_hosts/README.md index 61798d4f4..b4bff553b 100644 --- a/roles/sap_maintain_etc_hosts/README.md +++ b/roles/sap_maintain_etc_hosts/README.md @@ -123,7 +123,7 @@ Following dictionary keys can be defined: - _Type:_ `string` - **node_domain**
- Domain name of the managed node. Defaults to `sap_domain` if set or `ansible_domain`.
+ Domain name of the managed node. Defaults to `sap_domain` if set or `ansible_facts['domain']`.
**Required** for adding new entries to `/etc/hosts`.
_Optional_ for removing entries, when `node_name` is used. diff --git a/roles/sap_maintain_etc_hosts/defaults/main.yml b/roles/sap_maintain_etc_hosts/defaults/main.yml index 302ce0a1a..2e05cb6fa 100644 --- a/roles/sap_maintain_etc_hosts/defaults/main.yml +++ b/roles/sap_maintain_etc_hosts/defaults/main.yml @@ -16,7 +16,7 @@ # When deleting a node use only when node_ip is not defined # - node_domain # Domainname of the node -# Defaults to sap_domain, if set, otherwise ansible_domain is the default +# Defaults to sap_domain, if set, otherwise ansible_facts['domain'] is the default # When deleting a node use only when node_name is defined # - aliases # List of aliases for the node diff --git a/roles/sap_maintain_etc_hosts/meta/argument_specs.yml b/roles/sap_maintain_etc_hosts/meta/argument_specs.yml index 721ab9b5e..eb7d4ca2b 100644 --- a/roles/sap_maintain_etc_hosts/meta/argument_specs.yml +++ b/roles/sap_maintain_etc_hosts/meta/argument_specs.yml @@ -30,7 +30,7 @@ argument_specs: type: str description: - Domainname of the node - - _Optional. Defaults to sap_domain, if set, otherwise ansible_domain is the default_ + - _Optional. Defaults to sap_domain, if set, otherwise ansible_facts['domain'] is the default_ - _Optional. when deleting a node use only when node_name is defined_ aliases: type: list diff --git a/roles/sap_maintain_etc_hosts/tasks/main.yml b/roles/sap_maintain_etc_hosts/tasks/main.yml index f18877aa8..bde300f26 100644 --- a/roles/sap_maintain_etc_hosts/tasks/main.yml +++ b/roles/sap_maintain_etc_hosts/tasks/main.yml @@ -43,19 +43,19 @@ - name: Ensure required defaults are read from setup module when: > - not ((ansible_hostname is defined) and - (ansible_domain is defined) and - (ansible_default_ipv4 is defined)) + not ((ansible_facts['hostname'] is defined) and + (ansible_facts['domain'] is defined) and + (ansible_facts['default_ipv4'] is defined)) ## this is equivalent to - # (ansible_hostname is undefined) or - # (ansible_domain is undefined) or - # (ansible_default_ipv4 is defined) + # (ansible_facts['hostname'] is undefined) or + # (ansible_facts['domain'] is undefined) or + # (ansible_facts['default_ipv4'] is defined) ansible.builtin.setup: gather_subset: "{{ __sap_maintain_etc_hosts_gather_subset }}" filter: - - "ansible_hostname" - - "ansible_domain" - - "ansible_default_ipv4" + - "ansible_facts['hostname']" + - "ansible_facts['domain']" + - "ansible_facts['default_ipv4']" # when sap_maintain_etc_hosts_list is empty, set defaults for local host - name: Ensure sap_maintain_etc_hosts_list is filled with defaults @@ -65,9 +65,9 @@ ( sap_maintain_etc_hosts_list | trim == '') ansible.builtin.set_fact: sap_maintain_etc_hosts_list: - - node_ip: "{{ ansible_default_ipv4.address }}" - node_name: "{{ ansible_hostname }}" - node_domain: "{{ sap_domain | default(ansible_domain) }}" + - node_ip: "{{ ansible_facts['default_ipv4'].address }}" + node_name: "{{ ansible_facts['hostname'] }}" + node_domain: "{{ sap_domain | default(ansible_facts['domain']) }}" node_comment: "managed by ansible sap_maintain_etc_hosts role" state: present diff --git a/roles/sap_maintain_etc_hosts/tasks/update_host_present.yml b/roles/sap_maintain_etc_hosts/tasks/update_host_present.yml index 696106e5c..6556692ea 100644 --- a/roles/sap_maintain_etc_hosts/tasks/update_host_present.yml +++ b/roles/sap_maintain_etc_hosts/tasks/update_host_present.yml @@ -35,7 +35,7 @@ ansible.builtin.set_fact: __sap_maintain_etc_hosts_domain: "{{ thishost.node_domain if thishost.node_domain is defined and thishost.node_domain != '' - else (sap_domain if sap_domain is defined and sap_domain != '' else ansible_domain | d('')) }}" + else (sap_domain if sap_domain is defined and sap_domain != '' else ansible_facts['domain'] | d('')) }}" - name: Verify that variable domain_name is set ansible.builtin.assert: diff --git a/roles/sap_netweaver_preconfigure/handlers/main.yml b/roles/sap_netweaver_preconfigure/handlers/main.yml index 36deda91e..144be8b86 100644 --- a/roles/sap_netweaver_preconfigure/handlers/main.yml +++ b/roles/sap_netweaver_preconfigure/handlers/main.yml @@ -46,14 +46,14 @@ __sap_netweaver_preconfigure_uefi_boot_dir: /boot/efi/EFI/redhat/grub.cfg listen: __sap_netweaver_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_netweaver_preconfigure_uefi_boot_dir: /boot/efi/EFI/BOOT/grub.cfg listen: __sap_netweaver_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: @@ -97,7 +97,7 @@ timeout: 30 listen: __sap_netweaver_preconfigure_reboot_handler when: - - ansible_os_family == 'Suse' + - ansible_facts['os_family'] == 'Suse' - sap_netweaver_preconfigure_reboot_ok | d(false) changed_when: false diff --git a/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-configuration.yml b/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-configuration.yml index c1bc7b7ac..4b826f1b9 100644 --- a/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-configuration.yml +++ b/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-configuration.yml @@ -22,10 +22,10 @@ - name: Assert that enough swap space is configured ansible.builtin.assert: that: - - (ansible_swaptotal_mb | int) >= (sap_netweaver_preconfigure_min_swap_space_mb | int) - fail_msg: "FAIL: The system has only {{ ansible_swaptotal_mb }} MB of swap space configured, + - (ansible_facts['swaptotal_mb'] | int) >= (sap_netweaver_preconfigure_min_swap_space_mb | int) + fail_msg: "FAIL: The system has only {{ ansible_facts['swaptotal_mb'] }} MB of swap space configured, which is less than the minimum required amount of {{ sap_netweaver_preconfigure_min_swap_space_mb }} MB for SAP NetWeaver!" - success_msg: "PASS: The system has {{ ansible_swaptotal_mb }} MB of swap space configured, + success_msg: "PASS: The system has {{ ansible_facts['swaptotal_mb'] }} MB of swap space configured, which is equal to or more than the minimum required amount of {{ sap_netweaver_preconfigure_min_swap_space_mb }} MB for SAP NetWeaver." when: sap_netweaver_preconfigure_fail_if_not_enough_swap_space_configured ignore_errors: "{{ sap_netweaver_preconfigure_assert_ignore_errors | d(false) }}" diff --git a/roles/sap_netweaver_preconfigure/tasks/RedHat/configuration.yml b/roles/sap_netweaver_preconfigure/tasks/RedHat/configuration.yml index cf360bcb9..d85118872 100644 --- a/roles/sap_netweaver_preconfigure/tasks/RedHat/configuration.yml +++ b/roles/sap_netweaver_preconfigure/tasks/RedHat/configuration.yml @@ -15,18 +15,18 @@ - name: Warn if not enough swap space is configured ansible.builtin.fail: msg: | - The system has only {{ ansible_swaptotal_mb }} MB of swap space configured, + The system has only {{ ansible_facts['swaptotal_mb'] }} MB of swap space configured, which is less than the minimum required amount of {{ sap_netweaver_preconfigure_min_swap_space_mb }} MB for SAP NetWeaver! ignore_errors: true when: - - ansible_swaptotal_mb < sap_netweaver_preconfigure_min_swap_space_mb|int + - ansible_facts['swaptotal_mb'] < sap_netweaver_preconfigure_min_swap_space_mb|int - not sap_netweaver_preconfigure_fail_if_not_enough_swap_space_configured|d(true) - name: Fail if not enough swap space is configured ansible.builtin.fail: msg: | - The system has only {{ ansible_swaptotal_mb }} MB of swap space configured, + The system has only {{ ansible_facts['swaptotal_mb'] }} MB of swap space configured, which is less than the minimum required amount of {{ sap_netweaver_preconfigure_min_swap_space_mb }} MB for SAP NetWeaver! when: - - ansible_swaptotal_mb < sap_netweaver_preconfigure_min_swap_space_mb|int + - ansible_facts['swaptotal_mb'] < sap_netweaver_preconfigure_min_swap_space_mb|int - sap_netweaver_preconfigure_fail_if_not_enough_swap_space_configured|d(true) diff --git a/roles/sap_netweaver_preconfigure/tasks/RedHat/installation.yml b/roles/sap_netweaver_preconfigure/tasks/RedHat/installation.yml index a0ba21817..ae7693d02 100644 --- a/roles/sap_netweaver_preconfigure/tasks/RedHat/installation.yml +++ b/roles/sap_netweaver_preconfigure/tasks/RedHat/installation.yml @@ -14,5 +14,5 @@ state: present name: "{{ __sap_netweaver_preconfigure_adobe_doc_services_packages }}" when: - - ansible_architecture == 'x86_64' + - ansible_facts['architecture'] == 'x86_64' - sap_netweaver_preconfigure_use_adobe_doc_services diff --git a/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml b/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml index 42c1afa77..7771555cf 100644 --- a/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml +++ b/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml @@ -50,9 +50,9 @@ - name: Assert that adequate swap is configured ansible.builtin.assert: - that: ansible_swaptotal_mb > (sap_netweaver_preconfigure_min_swap_space_mb | int) + that: ansible_facts['swaptotal_mb'] > (sap_netweaver_preconfigure_min_swap_space_mb | int) fail_msg: "FAIL: A minimum of {{ sap_netweaver_preconfigure_min_swap_space_mb - }}MiB is required but only {{ ansible_swaptotal_mb }}MiB was discovered" + }}MiB is required but only {{ ansible_facts['swaptotal_mb'] }}MiB was discovered" success_msg: "PASS: the system has at least {{ sap_netweaver_preconfigure_min_swap_space_mb }}MiB of swap configured" when: sap_netweaver_preconfigure_fail_if_not_enough_swap_space_configured diff --git a/roles/sap_netweaver_preconfigure/tasks/SLES/configuration.yml b/roles/sap_netweaver_preconfigure/tasks/SLES/configuration.yml index 14d77af48..392344dcd 100644 --- a/roles/sap_netweaver_preconfigure/tasks/SLES/configuration.yml +++ b/roles/sap_netweaver_preconfigure/tasks/SLES/configuration.yml @@ -72,19 +72,19 @@ - name: Warn if not enough swap space is configured ansible.builtin.fail: - msg: "WARN: The system has only {{ ansible_swaptotal_mb }} MB of swap space configured, + msg: "WARN: The system has only {{ ansible_facts['swaptotal_mb'] }} MB of swap space configured, which is less than the minimum required amount of {{ sap_netweaver_preconfigure_min_swap_space_mb }} MB for SAP NetWeaver!" ignore_errors: true when: - - ansible_swaptotal_mb < sap_netweaver_preconfigure_min_swap_space_mb|int + - ansible_facts['swaptotal_mb'] < sap_netweaver_preconfigure_min_swap_space_mb|int - not sap_netweaver_preconfigure_fail_if_not_enough_swap_space_configured|d(true) - name: Fail if not enough swap space is configured ansible.builtin.fail: - msg: "FAIL: The system has only {{ ansible_swaptotal_mb }} MB of swap space configured, + msg: "FAIL: The system has only {{ ansible_facts['swaptotal_mb'] }} MB of swap space configured, which is less than the minimum required amount of {{ sap_netweaver_preconfigure_min_swap_space_mb }} MB for SAP NetWeaver!" when: - - ansible_swaptotal_mb < sap_netweaver_preconfigure_min_swap_space_mb|int + - ansible_facts['swaptotal_mb'] < sap_netweaver_preconfigure_min_swap_space_mb|int - sap_netweaver_preconfigure_fail_if_not_enough_swap_space_configured|d(true) diff --git a/roles/sap_netweaver_preconfigure/tasks/SLES/generic/saptune_install.yml b/roles/sap_netweaver_preconfigure/tasks/SLES/generic/saptune_install.yml index 1b2bb0ce8..3e50541a6 100644 --- a/roles/sap_netweaver_preconfigure/tasks/SLES/generic/saptune_install.yml +++ b/roles/sap_netweaver_preconfigure/tasks/SLES/generic/saptune_install.yml @@ -11,10 +11,10 @@ - name: Set fact if baseproduct contains SLES without SLES_SAP ansible.builtin.set_fact: __sap_netweaver_preconfigure_use_saptune: false - when: - - '"SLES_SAP" not in __sap_netweaver_preconfigure_register_baseproduct.stat.lnk_target' - - '"SLES" in __sap_netweaver_preconfigure_register_baseproduct.stat.lnk_target - and ansible_distribution_major_version | int < 16' + when: >- + "SLES_SAP" not in __sap_netweaver_preconfigure_register_baseproduct.stat.lnk_target + and ("SLES" in __sap_netweaver_preconfigure_register_baseproduct.stat.lnk_target + and ansible_facts['distribution_major_version'] | int < 16) - name: Block to ensure saptune is installed diff --git a/roles/sap_netweaver_preconfigure/tasks/SLES/generic/saptune_takeover.yml b/roles/sap_netweaver_preconfigure/tasks/SLES/generic/saptune_takeover.yml index 5528ac0da..67c70b0bf 100644 --- a/roles/sap_netweaver_preconfigure/tasks/SLES/generic/saptune_takeover.yml +++ b/roles/sap_netweaver_preconfigure/tasks/SLES/generic/saptune_takeover.yml @@ -15,7 +15,7 @@ - __sap_netweaver_preconfigure_use_saptune - __sap_netweaver_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_netweaver_preconfigure/tasks/main.yml b/roles/sap_netweaver_preconfigure/tasks/main.yml index 008ac18bc..c9f71a849 100644 --- a/roles/sap_netweaver_preconfigure/tasks/main.yml +++ b/roles/sap_netweaver_preconfigure/tasks/main.yml @@ -16,16 +16,16 @@ loop: "{{ __var_files }}" vars: __vars_file: "{{ role_path }}/vars/{{ item }}" - __distribution_major: "{{ ansible_distribution ~ '_' ~ ansible_distribution_major_version }}" - __distribution_minor: "{{ ansible_distribution ~ '_' ~ ansible_distribution_version }}" + __distribution_major: "{{ ansible_facts['distribution'] ~ '_' ~ ansible_facts['distribution_major_version'] }}" + __distribution_minor: "{{ ansible_facts['distribution'] ~ '_' ~ ansible_facts['distribution_version'] }}" # Enables loading of shared vars between SLES and SLES_SAP - __distribution_major_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_major_version }}" - __distribution_minor_split: "{{ ansible_distribution.split('_')[0] ~ '_' ~ ansible_distribution_version }}" + __distribution_major_split: "{{ ansible_facts['distribution'].split('_')[0] ~ '_' ~ ansible_facts['distribution_major_version'] }}" + __distribution_minor_split: "{{ ansible_facts['distribution'].split('_')[0] ~ '_' ~ ansible_facts['distribution_version'] }}" __var_files: >- {{ [ - 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_major_split ~ '.yml') if __distribution_major_split != __distribution_major else None, (__distribution_minor_split ~ '.yml') if __distribution_minor_split != __distribution_minor else None, __distribution_major ~ '.yml', @@ -52,12 +52,12 @@ ansible.builtin.include_tasks: '{{ item }}/{{ __sap_netweaver_preconfigure_fact_assert_filename_prefix }}installation.yml' when: sap_netweaver_preconfigure_config_all|d(true) or sap_netweaver_preconfigure_installation|d(false) with_first_found: - - '{{ ansible_distribution.split("_")[0] }}' - - '{{ ansible_distribution }}' + - "{{ ansible_facts['distribution'].split('_')[0] }}" + - "{{ ansible_facts['distribution'] }}" - name: Include tasks from 'configuration.yml' ansible.builtin.include_tasks: '{{ item }}/{{ __sap_netweaver_preconfigure_fact_assert_filename_prefix }}configuration.yml' when: sap_netweaver_preconfigure_config_all|d(true) or sap_netweaver_preconfigure_configuration|d(false) with_first_found: - - '{{ ansible_distribution.split("_")[0] }}' - - '{{ ansible_distribution }}' + - "{{ ansible_facts['distribution'].split('_')[0] }}" + - "{{ ansible_facts['distribution'] }}" diff --git a/roles/sap_netweaver_preconfigure/vars/SLES_15.yml b/roles/sap_netweaver_preconfigure/vars/SLES_15.yml index a55158988..41213c7ce 100644 --- a/roles/sap_netweaver_preconfigure/vars/SLES_15.yml +++ b/roles/sap_netweaver_preconfigure/vars/SLES_15.yml @@ -38,7 +38,7 @@ __sap_netweaver_preconfigure_packages: # Recommended for System monitoring - cpupower - - "{{ 'libcpupower0' if ansible_distribution_version is version('15.6', '<') else 'libcpupower1' }}" + - "{{ 'libcpupower0' if ansible_facts['distribution_version'] is version('15.6', '<') else 'libcpupower1' }}" - libsensors4 # Additional packages diff --git a/roles/sap_netweaver_preconfigure/vars/SLES_SAP_15.yml b/roles/sap_netweaver_preconfigure/vars/SLES_SAP_15.yml index 73692ff80..74e270fb3 100644 --- a/roles/sap_netweaver_preconfigure/vars/SLES_SAP_15.yml +++ b/roles/sap_netweaver_preconfigure/vars/SLES_SAP_15.yml @@ -38,7 +38,7 @@ __sap_netweaver_preconfigure_packages: # Recommended for System monitoring - cpupower - - "{{ 'libcpupower0' if ansible_distribution_version is version('15.6', '<') else 'libcpupower1' }}" + - "{{ 'libcpupower0' if ansible_facts['distribution_version'] is version('15.6', '<') else 'libcpupower1' }}" - libsensors4 # Additional packages