From b6a188c4f29c185da7cc68704b83e0a447563496 Mon Sep 17 00:00:00 2001 From: Bernd Finger <> Date: Sun, 24 Oct 2021 23:37:05 +0200 Subject: [PATCH 1/4] solve issue #208 --- .ansible-lint | 19 +++++ .gitignore | 4 +- handlers/main.yml | 9 ++- meta/main.yml | 17 ++-- tasks/RedHat/assert-installation.yml | 27 ++++--- ...lock.yml => assert-2055470-loop-block.yml} | 0 ...lock.yml => assert-2382421-loop-block.yml} | 0 ...lock.yml => assert-3024346-loop-block.yml} | 0 tasks/RedHat/generic/assert-abrt-ccpp.yml | 3 - tasks/RedHat/generic/assert-abrtd.yml | 3 - .../generic/assert-auto-numa-balancing.yml | 3 - .../assert-c-states-for-lower-latency.yml | 3 - tasks/RedHat/generic/assert-coredumps.yml | 3 - .../assert-cpu-governor-for-performance.yml | 9 +-- tasks/RedHat/generic/assert-epb.yml | 12 +-- tasks/RedHat/generic/assert-firewalld.yml | 3 - tasks/RedHat/generic/assert-kdump.yml | 3 - tasks/RedHat/generic/assert-ksm.yml | 3 - tasks/RedHat/generic/assert-services.yml | 3 - tasks/RedHat/generic/assert-thp.yml | 3 - tasks/RedHat/generic/assert-tsx.yml | 3 - tasks/RedHat/generic/assert-tuned.yml | 13 ++- .../configure-c-states-for-lower-latency.yml | 3 - ...configure-cpu-governor-for-performance.yml | 19 +++-- tasks/RedHat/generic/configure-epb.yml | 16 ++-- tasks/RedHat/generic/configure-tuned.yml | 33 ++++---- tasks/RedHat/generic/disable-abrt-ccpp.yml | 3 - tasks/RedHat/generic/disable-abrtd.yml | 3 - tasks/RedHat/generic/disable-coredumps.yml | 9 ++- tasks/RedHat/generic/disable-firewalld.yml | 3 - tasks/RedHat/generic/disable-kdump.yml | 3 - tasks/RedHat/generic/disable-ksm.yml | 15 ++-- tasks/RedHat/generic/disable-services.yml | 3 - tasks/RedHat/generic/disable-thp.yml | 3 - tasks/RedHat/generic/enable-tsx.yml | 3 - .../generic/turn-off-auto-numa-balancing.yml | 3 - tasks/RedHat/installation.yml | 81 ++++++++++++------- tasks/main.yml | 4 +- tasks/sapnote/2009879.yml | 2 +- tasks/sapnote/2055470.yml | 7 +- tasks/sapnote/2292690.yml | 6 +- tasks/sapnote/2292690/01-assert-tuned.yml | 3 +- tasks/sapnote/2292690/01-configure-tuned.yml | 3 +- .../2292690/02-assert-auto-numa-balancing.yml | 3 +- .../02-turn-off-auto-numa-balancing.yml | 3 +- tasks/sapnote/2292690/03-assert-thp.yml | 3 +- tasks/sapnote/2292690/03-disable-thp.yml | 3 +- .../04-assert-c-states-for-lower-latency.yml | 3 +- ...4-configure-c-states-for-lower-latency.yml | 3 +- .../2292690/05-assert-cpu-governor.yml | 3 +- .../2292690/05-configure-cpu-governor.yml | 3 +- tasks/sapnote/2292690/06-assert-epb.yml | 3 +- tasks/sapnote/2292690/06-configure-epb.yml | 3 +- tasks/sapnote/2292690/07-assert-ksm.yml | 3 +- tasks/sapnote/2292690/07-disable-ksm.yml | 3 +- tasks/sapnote/2292690/08-assert-selinux.yml | 5 -- tasks/sapnote/2292690/08-disable-selinux.yml | 5 -- .../sapnote/2292690/09-assert-etc-sudoers.yml | 3 +- .../sapnote/2292690/09-check-etc-sudoers.yml | 4 +- .../2292690/10-assert-ibm-energyscale.yml | 3 +- tasks/sapnote/2292690/10-ibm-energyscale.yml | 4 +- tasks/sapnote/2382421.yml | 3 +- tasks/sapnote/2777782.yml | 4 +- tasks/sapnote/2777782/02-assert-tuned.yml | 3 +- tasks/sapnote/2777782/02-configure-tuned.yml | 3 +- .../03-assert-abrt-coredumps-kdump.yml | 3 +- .../03-disable-abrt-coredumps-kdump.yml | 3 +- .../2777782/04-assert-auto-numa-balancing.yml | 3 +- .../04-turn-off-auto-numa-balancing.yml | 3 +- tasks/sapnote/2777782/05-assert-thp.yml | 3 +- tasks/sapnote/2777782/05-disable-thp.yml | 3 +- .../06-assert-c-states-for-lower-latency.yml | 3 +- ...6-configure-c-states-for-lower-latency.yml | 3 +- .../2777782/07-assert-cpu-governor.yml | 3 +- .../2777782/07-configure-cpu-governor.yml | 3 +- tasks/sapnote/2777782/08-assert-epb.yml | 3 +- tasks/sapnote/2777782/08-configure-epb.yml | 3 +- tasks/sapnote/2777782/09-assert-ksm.yml | 3 +- tasks/sapnote/2777782/09-disable-ksm.yml | 3 +- tasks/sapnote/2777782/10-assert-pidmax.yml | 3 +- tasks/sapnote/2777782/10-increase-pidmax.yml | 5 +- tasks/sapnote/2777782/11-assert-tsx.yml | 3 +- tasks/sapnote/2777782/11-enable-tsx.yml | 3 +- tasks/sapnote/3024346.yml | 8 +- tasks/sapnote/assert-2009879.yml | 5 +- tasks/sapnote/assert-2009879_7.yml | 3 - tasks/sapnote/assert-2055470.yml | 13 ++- tasks/sapnote/assert-2292690.yml | 9 +-- tasks/sapnote/assert-2382421.yml | 7 +- tasks/sapnote/assert-2777782.yml | 7 +- tasks/sapnote/assert-3024346.yml | 7 +- 91 files changed, 283 insertions(+), 273 deletions(-) create mode 100644 .ansible-lint rename tasks/RedHat/generic/{sapnote-2055470-loop-block.yml => assert-2055470-loop-block.yml} (100%) rename tasks/RedHat/generic/{sapnote-2382421-loop-block.yml => assert-2382421-loop-block.yml} (100%) rename tasks/RedHat/generic/{sapnote-3024346-loop-block.yml => assert-3024346-loop-block.yml} (100%) delete mode 100644 tasks/sapnote/2292690/08-assert-selinux.yml delete mode 100644 tasks/sapnote/2292690/08-disable-selinux.yml diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..076d985 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,19 @@ +skip_list: +# We do not intend to change the role name + - role-name + +exclude_paths: +- tasks/SLES +- tasks/SLES15 +- tasks/sapnote/1275776 # SLES - sapconf, saptune, etc +- tasks/sapnote/1944799 # SLES - HANA install and config guidelines +- tasks/sapnote/2013638.yml # RHEL 6.5 - OS settings +- tasks/sapnote/2136965.yml # RHEL 6.6 - OS settings +- tasks/sapnote/2247020.yml # RHEL 6.7 - OS settings +- tasks/sapnote/2578899 # SLES 15 - installation +- tasks/sapnote/2684254 # SLES 15 - OS settings for HANA +- vars/RedHat_6.5.yml +- vars/RedHat_6.6.yml +- vars/RedHat_6.7.yml +- vars/SLES_15.yml + diff --git a/.gitignore b/.gitignore index a7256f9..ceddaa3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -*.swp -*.retry - +.cache/ diff --git a/handlers/main.yml b/handlers/main.yml index 8387bc7..e511955 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -9,7 +9,8 @@ when: - sap_hana_preconfigure_run_grub2_mkconfig|d(true) -- debug: +- name: Display stat of /sys/firmware/efi + debug: var: __sap_hana_preconfigure_register_stat_sys_firmware_efi.stat.exists listen: __sap_hana_preconfigure_regenerate_grub2_conf_handler when: @@ -24,7 +25,8 @@ - not __sap_hana_preconfigure_register_stat_sys_firmware_efi.stat.exists - sap_hana_preconfigure_run_grub2_mkconfig|d(true) -- debug: +- name: BIOS - Display the output of grub2-mkconfig + debug: var: __sap_hana_preconfigure_register_grub2_mkconfig_bios_mode.stdout_lines, __sap_hana_preconfigure_register_grub2_mkconfig_bios_mode.stderr_lines listen: __sap_hana_preconfigure_regenerate_grub2_conf_handler @@ -41,7 +43,8 @@ - __sap_hana_preconfigure_register_stat_sys_firmware_efi.stat.exists - sap_hana_preconfigure_run_grub2_mkconfig|d(true) -- debug: +- name: UEFI - Display the output of grub2-mkconfig + debug: var: __sap_hana_preconfigure_register_grub2_mkconfig_uefi_mode.stdout_lines, __sap_hana_preconfigure_register_grub2_mkconfig_uefi_mode.stderr_lines listen: __sap_hana_preconfigure_regenerate_grub2_conf_handler diff --git a/meta/main.yml b/meta/main.yml index 6c7e601..56b9a2a 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,14 +1,11 @@ galaxy_info: - author: Markus Koch, Thomas Bludau, Bernd Finger , Than Ngo - description: Configures a RHEL OS to be ready for SAP HANA installation - license: GNU General Public License v3.0 - min_ansible_version: 2.5 + author: Markus Koch, Thomas Bludau, Bernd Finger, Than Ngo + description: Performs SAP HANA specific preparation steps on a RHEL system + company: Red Hat, Inc. + license: Apache + min_ansible_version: 2.9 platforms: - name: EL - versions: [ 6, 7, 8 ] - - galaxy_tags: [ 'system', 'sap', 'hana', 'beta' ] - + versions: [ 7, 8 ] + galaxy_tags: [ 'sap', 'hana', 'rhel' ] dependencies: [] - # List your role dependencies here, one per line. Be sure to remove the '[]' above, - # if you add dependencies to this list. diff --git a/tasks/RedHat/assert-installation.yml b/tasks/RedHat/assert-installation.yml index 63f7162..9780279 100644 --- a/tasks/RedHat/assert-installation.yml +++ b/tasks/RedHat/assert-installation.yml @@ -17,12 +17,13 @@ when: not sap_hana_preconfigure_min_rhel_release_check # repos required for SAP HANA on RHEL 7 and RHEL 8: -- set_fact: +- name: Fill the variable for the generic list of required repos + set_fact: __sap_hana_preconfigure_required_repos: "{{ lookup('vars','__sap_hana_preconfigure_req_repos_RedHat_' + ansible_distribution_version|string|replace (\".\", \"_\") + '_' + ansible_architecture|string) }}" - name: Get info about enabled repos - shell: subscription-manager repos --list-enabled | awk '/Repo ID:/{print $NF}' + shell: set -o pipefail && subscription-manager repos --list-enabled | awk '/Repo ID:/{print $NF}' register: __sap_hana_preconfigure_register_enabled_repos_assert changed_when: no @@ -38,12 +39,13 @@ ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - name: Detect if and how the minor RHEL release is set - shell: subscription-manager release | awk 'NF==2{printf $NF}NF!=2{print}' + shell: set -o pipefail && subscription-manager release | awk 'NF==2{printf $NF}NF!=2{print}' register: __sap_hana_preconfigure_register_subscription_manager_release_assert changed_when: no ignore_errors: yes -- debug: +- name: Display the output of the subscription-manager release command + debug: var: __sap_hana_preconfigure_register_subscription_manager_release_assert - name: Assert that the RHEL version is locked correctly @@ -55,7 +57,8 @@ ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" when: "ansible_distribution_version != '7.9'" -- debug: +- name: Report that checking the release lock is not necessary if the system is on RHEL 7.9 + 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'" @@ -79,7 +82,7 @@ ### # yum -y install ibm-power-managed-rhel7 ### - name: Get install status of required IBM packages - shell: yum info installed {{ __sap_hana_preconfigure_required_ppc64le | map('quote') | join(' ') }} | awk '/Name/{n=$NF}/Version/{v=$NF}/Release/{r=$NF}/Description/{printf ("%s\n", n)}' + shell: set -o pipefail && yum info installed {{ __sap_hana_preconfigure_required_ppc64le | map('quote') | join(' ') }} | awk '/Name/{n=$NF}/Version/{v=$NF}/Release/{r=$NF}/Description/{printf ("%s\n", n)}' register: __sap_hana_preconfigure_register_required_ppc64le_packages_assert changed_when: no args: @@ -159,7 +162,8 @@ - __sap_hana_preconfigure_min_pkgs|d([]) - sap_hana_preconfigure_assert_ignore_errors|d(false) -- debug: +- name: Report if no minimum required package version is defined for this RHEL release + debug: msg: "INFO: No minimum required package version defined (variable __sap_hana_preconfigure_min_pkgs)." when: not __sap_hana_preconfigure_min_pkgs|d([]) @@ -180,7 +184,8 @@ ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" when: sap_hana_preconfigure_update -- debug: +- name: Report if checking for possible package updates is not requested + debug: msg: "INFO: Not checking for possible package updates (variable sap_hana_preconfigure_update)." when: not sap_hana_preconfigure_update @@ -209,10 +214,12 @@ - ansible_os_family == 'RedHat' - ansible_distribution_version == '8.0' -- debug: +- name: Display the command for checking a reboot requirement + debug: var: __sap_hana_preconfigure_fact_needs_restarting_command_assert -- name: Check if system needs to be restarted +# Reason for noqa: The command to be executed might contain pipes +- name: Check if system needs to be restarted # noqa command-instead-of-shell shell: "{{ __sap_hana_preconfigure_fact_needs_restarting_command_assert }}" register: __sap_hana_preconfigure_register_needs_restarting_assert changed_when: false diff --git a/tasks/RedHat/generic/sapnote-2055470-loop-block.yml b/tasks/RedHat/generic/assert-2055470-loop-block.yml similarity index 100% rename from tasks/RedHat/generic/sapnote-2055470-loop-block.yml rename to tasks/RedHat/generic/assert-2055470-loop-block.yml diff --git a/tasks/RedHat/generic/sapnote-2382421-loop-block.yml b/tasks/RedHat/generic/assert-2382421-loop-block.yml similarity index 100% rename from tasks/RedHat/generic/sapnote-2382421-loop-block.yml rename to tasks/RedHat/generic/assert-2382421-loop-block.yml diff --git a/tasks/RedHat/generic/sapnote-3024346-loop-block.yml b/tasks/RedHat/generic/assert-3024346-loop-block.yml similarity index 100% rename from tasks/RedHat/generic/sapnote-3024346-loop-block.yml rename to tasks/RedHat/generic/assert-3024346-loop-block.yml diff --git a/tasks/RedHat/generic/assert-abrt-ccpp.yml b/tasks/RedHat/generic/assert-abrt-ccpp.yml index e826a87..f74e27c 100644 --- a/tasks/RedHat/generic/assert-abrt-ccpp.yml +++ b/tasks/RedHat/generic/assert-abrt-ccpp.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/assert-abrt-ccpp.yml" - - name: Assert that service abrt-ccpp is disabled, and inactive or stopped include_tasks: assert-services.yml vars: diff --git a/tasks/RedHat/generic/assert-abrtd.yml b/tasks/RedHat/generic/assert-abrtd.yml index 6b1d2c2..f8c9ac5 100644 --- a/tasks/RedHat/generic/assert-abrtd.yml +++ b/tasks/RedHat/generic/assert-abrtd.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/assert-abrtd.yml" - - name: Assert that service abrtd is disabled, and inactive or stopped include_tasks: assert-services.yml vars: diff --git a/tasks/RedHat/generic/assert-auto-numa-balancing.yml b/tasks/RedHat/generic/assert-auto-numa-balancing.yml index 3d93954..8a763cb 100644 --- a/tasks/RedHat/generic/assert-auto-numa-balancing.yml +++ b/tasks/RedHat/generic/assert-auto-numa-balancing.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/assert-auto-numa-balancing.yml" - # can be configured by tuned profile sap-hana, entry "kernel.numa_balancing = 0" - name: Assert that service numad is disabled, and inactive or stopped, if tuned is not to be used include_tasks: assert-services.yml diff --git a/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml b/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml index e42bf2e..6149a9a 100644 --- a/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml +++ b/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/assert-c-states-for-lower-latency.yml" - # can be configured by tuned profile sap-hana, entry "force_latency=70" - block: - name: Get contents of GRUB_CMDLINE_LINUX in /etc/default/grub diff --git a/tasks/RedHat/generic/assert-coredumps.yml b/tasks/RedHat/generic/assert-coredumps.yml index b139b8f..838e8ac 100644 --- a/tasks/RedHat/generic/assert-coredumps.yml +++ b/tasks/RedHat/generic/assert-coredumps.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/assert-coredumps.yml" - - name: Get info about file /etc/security/limits.d/99-sap.conf stat: path: /etc/security/limits.d/99-sap.conf diff --git a/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml b/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml index 379b43c..696e67d 100644 --- a/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml +++ b/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/assert-cpu-governor-for-performance.yml" - # can be configured by tuned profile sap-hana, entry "governor=performance" # in included tuned profile throughput-performance - block: @@ -13,7 +10,8 @@ ignore_errors: true changed_when: no - - debug: + - name: Assert - Display the output of the cpupower frequency-info -g command + debug: var: __sap_hana_preconfigure_register_cpupower_frequency_info_supported_assert.stdout_lines, __sap_hana_preconfigure_register_cpupower_frequency_info_supported_assert.stderr_lines @@ -80,7 +78,8 @@ when: "__sap_hana_preconfigure_register_cpupower_frequency_info_supported_assert.stdout != 'Not Available'" - - debug: + - name: Report if the system does not support setting the CPU Governor for performance + debug: msg: "INFO: The system is not capable of setting the CPU Governor for 'performance'." when: "__sap_hana_preconfigure_register_cpupower_frequency_info_supported_assert.stdout == 'Not Available'" diff --git a/tasks/RedHat/generic/assert-epb.yml b/tasks/RedHat/generic/assert-epb.yml index 02bae0f..afdfed3 100644 --- a/tasks/RedHat/generic/assert-epb.yml +++ b/tasks/RedHat/generic/assert-epb.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/assert-epb.yml" - # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" # 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 @@ -14,7 +11,8 @@ ignore_errors: true changed_when: no - - debug: + - name: Assert - Display the output of the cpupower info command + debug: var: __sap_hana_preconfigure_register_cpupower_info_epb_supported_assert.stdout_lines, __sap_hana_preconfigure_register_cpupower_info_epb_supported_assert.stderr_lines @@ -70,7 +68,8 @@ changed_when: no ignore_errors: yes - - debug: + - name: Assert - Display the output of the cpupower info command again + debug: var: __sap_hana_preconfigure_register_cpupower_info_epb_assert - name: Assert that the current setting of EPB is '0' (x86_64 platform only) @@ -82,7 +81,8 @@ when: "__sap_hana_preconfigure_register_cpupower_info_epb_supported_assert.stdout != 'does not support'" - - debug: + - name: Report if the system does not support EPB + debug: msg: "INFO: The system does not support Intel's performance bias setting (EPB)." when: "__sap_hana_preconfigure_register_cpupower_info_epb_supported_assert.stdout == 'does not support'" diff --git a/tasks/RedHat/generic/assert-firewalld.yml b/tasks/RedHat/generic/assert-firewalld.yml index 4299c8b..56f6ab7 100644 --- a/tasks/RedHat/generic/assert-firewalld.yml +++ b/tasks/RedHat/generic/assert-firewalld.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/assert-firewalld.yml" - - name: Assert that service firewalld is disabled, and inactive or stopped include_tasks: assert-services.yml vars: diff --git a/tasks/RedHat/generic/assert-kdump.yml b/tasks/RedHat/generic/assert-kdump.yml index eb209f1..5aa64ed 100644 --- a/tasks/RedHat/generic/assert-kdump.yml +++ b/tasks/RedHat/generic/assert-kdump.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/assert-kdump.yml" - - name: Assert that service kdump is disabled, and inactive or stopped include_tasks: assert-services.yml vars: diff --git a/tasks/RedHat/generic/assert-ksm.yml b/tasks/RedHat/generic/assert-ksm.yml index d696c35..0c30df5 100644 --- a/tasks/RedHat/generic/assert-ksm.yml +++ b/tasks/RedHat/generic/assert-ksm.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/assert-ksm.yml" - - name: Get info about file /etc/init.d/boot.local stat: path: /etc/init.d/boot.local diff --git a/tasks/RedHat/generic/assert-services.yml b/tasks/RedHat/generic/assert-services.yml index 01d0613..fd51203 100644 --- a/tasks/RedHat/generic/assert-services.yml +++ b/tasks/RedHat/generic/assert-services.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/assert-services.yml" - - name: Assert that service {{ __sap_hana_preconfigure_packages_and_services[line_item].svc }} is disabled if package {{ __sap_hana_preconfigure_packages_and_services[line_item].pkg }} is installed block: diff --git a/tasks/RedHat/generic/assert-thp.yml b/tasks/RedHat/generic/assert-thp.yml index f47d773..1a1fdea 100644 --- a/tasks/RedHat/generic/assert-thp.yml +++ b/tasks/RedHat/generic/assert-thp.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/assert-thp.yml" - # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" - block: - name: Get contents of GRUB_CMDLINE_LINUX in /etc/default/grub diff --git a/tasks/RedHat/generic/assert-tsx.yml b/tasks/RedHat/generic/assert-tsx.yml index 2aab79a..0d39705 100644 --- a/tasks/RedHat/generic/assert-tsx.yml +++ b/tasks/RedHat/generic/assert-tsx.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/assert-tsx.yml" - - block: # There are CPUs which are not capable of enabling the rtm flag, so we just report the status: - name: Get all CPU flags diff --git a/tasks/RedHat/generic/assert-tuned.yml b/tasks/RedHat/generic/assert-tuned.yml index d1be77c..c835e47 100644 --- a/tasks/RedHat/generic/assert-tuned.yml +++ b/tasks/RedHat/generic/assert-tuned.yml @@ -1,9 +1,6 @@ --- -- debug: - msg: "imported RedHat/generic/assert-tuned.yml" - -- name: Report tuned version +- name: Display the version of tuned debug: msg: "INFO: The installed version of package tuned is: {{ ansible_facts.packages['tuned'][0].version }}" when: "'tuned' in ansible_facts.packages and @@ -66,7 +63,7 @@ - "'tuned.service' in ansible_facts.services" - not sap_hana_preconfigure_use_tuned -- name: Report tuned-profiles-sap-hana version +- name: Display the version of tuned-profiles-sap-hana debug: msg: "INFO: The installed version of package 'tuned-profiles-sap-hana' is: {{ ansible_facts.packages['tuned-profiles-sap-hana'][0].version }}" when: "'tuned-profiles-sap-hana' in ansible_facts.packages and @@ -83,8 +80,10 @@ when: sap_hana_preconfigure_use_tuned or sap_hana_preconfigure_assert_all_config -- debug: - var: __sap_hana_preconfigure_register_current_tuned_profile_assert.stdout_lines, __sap_hana_preconfigure_register_current_tuned_profile_assert.stderr_lines +- name: Assert - Display the output of the tuned-adm active command + debug: + var: __sap_hana_preconfigure_register_current_tuned_profile_assert.stdout_lines, + __sap_hana_preconfigure_register_current_tuned_profile_assert.stderr_lines ignore_errors: yes when: sap_hana_preconfigure_use_tuned or sap_hana_preconfigure_assert_all_config diff --git a/tasks/RedHat/generic/configure-c-states-for-lower-latency.yml b/tasks/RedHat/generic/configure-c-states-for-lower-latency.yml index 9a88b87..6ea02af 100644 --- a/tasks/RedHat/generic/configure-c-states-for-lower-latency.yml +++ b/tasks/RedHat/generic/configure-c-states-for-lower-latency.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/configure-c-states-for-lower-latency.yml" - # can be configured by tuned profile sap-hana, entry "force_latency=70" - name: Configure C-States for lower latency lineinfile: diff --git a/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml b/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml index 8d66139..e41294f 100644 --- a/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml +++ b/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/configure-cpu-governor-for-performance.yml" - # can be configured by tuned profile sap-hana, entry "governor=performance" # in included tuned profile throughput-performance - block: @@ -12,7 +9,9 @@ register: __sap_hana_preconfigure_register_cpupower_frequency_info_supported ignore_errors: true changed_when: false - - debug: + + - name: Display the output of the cpupower frequency-info -g command + debug: var: __sap_hana_preconfigure_register_cpupower_frequency_info_supported.stdout_lines, __sap_hana_preconfigure_register_cpupower_frequency_info_supported.stderr_lines @@ -32,15 +31,21 @@ - name: Configure CPU Governor for performance on the running system (x86_64 platform only) command: cpupower frequency-set -g performance register: __sap_hana_preconfigure_register_cpupower_frequency_set - - debug: - var: __sap_hana_preconfigure_register_cpupower_frequency_set.stdout_lines, __sap_hana_preconfigure_register_cpupower_frequency_set.stderr_lines + + - name: Display the output of the cpupower frequency-set command + debug: + var: __sap_hana_preconfigure_register_cpupower_frequency_set.stdout_lines, + __sap_hana_preconfigure_register_cpupower_frequency_set.stderr_lines - name: Get status of CPU Governor command: cpupower frequency-info -g register: __sap_hana_preconfigure_register_cpupower_frequency_info ignore_errors: true changed_when: false - - debug: + + + - name: Display the output of the cpupower frequency-info -g command again + debug: var: __sap_hana_preconfigure_register_cpupower_frequency_info.stdout_lines, __sap_hana_preconfigure_register_cpupower_frequency_info.stderr_lines when: diff --git a/tasks/RedHat/generic/configure-epb.yml b/tasks/RedHat/generic/configure-epb.yml index 6cdd279..a18b545 100644 --- a/tasks/RedHat/generic/configure-epb.yml +++ b/tasks/RedHat/generic/configure-epb.yml @@ -1,20 +1,18 @@ --- -- debug: - msg: "imported RedHat/generic/configure-epb.yml" - # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" # 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 - block: - name: Check if system supports Intel's performance bias setting - shell: LC_ALL=C cpupower info | head -1 | awk '{print $2, $3, $4}' + shell: set -o pipefail && LC_ALL=C cpupower info | head -1 | awk '{print $2, $3, $4}' check_mode: no register: __sap_hana_preconfigure_register_cpupower_info_epb_supported ignore_errors: true changed_when: false - - debug: + - name: Display the output of the cpupower info command + debug: var: __sap_hana_preconfigure_register_cpupower_info_epb_supported.stdout_lines, __sap_hana_preconfigure_register_cpupower_info_epb_supported.stderr_lines @@ -34,7 +32,9 @@ - name: Configure EPB on the running system command: cpupower set -b 0 register: __sap_hana_preconfigure_register_cpupower_set - - debug: + + - name: Display the output of the cpupower set command + debug: var: __sap_hana_preconfigure_register_cpupower_set.stdout_lines, __sap_hana_preconfigure_register_cpupower_set.stderr_lines - name: Get status of EPB @@ -42,7 +42,9 @@ register: __sap_hana_preconfigure_register_cpupower_info ignore_errors: true changed_when: false - - debug: + + - name: Display the output of the cpupower info -b command + debug: var: __sap_hana_preconfigure_register_cpupower_info.stdout_lines, __sap_hana_preconfigure_register_cpupower_info.stderr_lines when: diff --git a/tasks/RedHat/generic/configure-tuned.yml b/tasks/RedHat/generic/configure-tuned.yml index d388653..f3300a5 100644 --- a/tasks/RedHat/generic/configure-tuned.yml +++ b/tasks/RedHat/generic/configure-tuned.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/configure-tuned.yml" - - block: - name: Enable and start tuned service: @@ -15,7 +12,9 @@ check_mode: no register: __sap_hana_preconfigure_register_current_tuned_profile changed_when: false - - debug: + + - name: Display the output of the tuned-adm active command + debug: var: __sap_hana_preconfigure_register_current_tuned_profile.stdout_lines, __sap_hana_preconfigure_register_current_tuned_profile.stderr_lines - name: Switch to tuned profile sap-hana if not currently active @@ -28,7 +27,9 @@ check_mode: no register: __sap_hana_preconfigure_register_new_tuned_profile changed_when: false - - debug: + + - name: Display the output of the tuned-adm active command after switching to profile sap-hana + debug: var: __sap_hana_preconfigure_register_new_tuned_profile.stdout_lines, __sap_hana_preconfigure_register_new_tuned_profile.stderr_lines when: @@ -39,7 +40,7 @@ - (ansible_architecture != "ppc64le" or (ansible_architecture == "ppc64le" and ansible_distribution_version != "8.0")) - block: - - name: On RHEL 8.0 on ppc64le, create directory /etc/tuned/sap-hana-ppc64le + - name: RHEL 8.0 ppc64le - create directory /etc/tuned/sap-hana-ppc64le file: path: /etc/tuned/sap-hana-ppc64le state: directory @@ -47,7 +48,7 @@ group: root mode: '0755' - - name: On RHEL 8.0 on ppc64le, copy file /etc/tuned/sap-hana-ppc64le/tuned.conf + - name: RHEL 8.0 ppc64le - copy file /etc/tuned/sap-hana-ppc64le/tuned.conf copy: src: etc/tuned/sap-hana-ppc64le/tuned.conf dest: /etc/tuned/sap-hana-ppc64le/tuned.conf @@ -56,25 +57,29 @@ mode: '0644' backup: yes - - name: On RHEL 8.0 on ppc64le, show active tuned profile again - shell: /usr/sbin/tuned-adm active | grep ":" | cut -d ":" -f 2 | awk '{$1=$1;print}' + - name: RHEL 8.0 ppc64le - show currently active tuned profile + shell: set -o pipefail && /usr/sbin/tuned-adm active | grep ":" | cut -d ":" -f 2 | awk '{$1=$1;print}' check_mode: no register: __sap_hana_preconfigure_register_current_tuned_profile_ppc64le changed_when: false - - debug: + + - name: RHEL 8.0 ppc64le - Display the output of the tuned-adm active command + debug: var: __sap_hana_preconfigure_register_current_tuned_profile_ppc64le.stdout_lines, __sap_hana_preconfigure_register_current_tuned_profile_ppc64le.stderr_lines - - name: On RHEL 8.0 on ppc64le, switch to tuned profiles sap-hana sap-hana-ppc64le if not currently active + - name: RHEL 8.0 ppc64le - switch to tuned profiles sap-hana sap-hana-ppc64le if not currently active block: - name: Switch to tuned profiles sap-hana sap-hana-ppc64le command: /usr/sbin/tuned-adm profile sap-hana sap-hana-ppc64le - - name: Show active tuned profile - shell: /usr/sbin/tuned-adm active | grep ":" | cut -d ":" -f 2 | awk '{$1=$1;print}' + - name: RHEL 8.0 ppc64le - Show new active tuned profile + shell: set -o pipefail && /usr/sbin/tuned-adm active | grep ":" | cut -d ":" -f 2 | awk '{$1=$1;print}' register: __sap_hana_preconfigure_register_new_tuned_profile_ppc64le changed_when: false - - debug: + + - name: RHEL 8.0 ppc64le - Display the output of the tuned-adm active command + debug: var: __sap_hana_preconfigure_register_new_tuned_profile_ppc64le.stdout_lines, __sap_hana_preconfigure_register_new_tuned_profile_ppc64le.stderr_lines diff --git a/tasks/RedHat/generic/disable-abrt-ccpp.yml b/tasks/RedHat/generic/disable-abrt-ccpp.yml index b9bf047..ed83129 100644 --- a/tasks/RedHat/generic/disable-abrt-ccpp.yml +++ b/tasks/RedHat/generic/disable-abrt-ccpp.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/disable-abrt-ccpp.yml" - - name: Disable abrt-ccpp include_tasks: disable-services.yml vars: diff --git a/tasks/RedHat/generic/disable-abrtd.yml b/tasks/RedHat/generic/disable-abrtd.yml index 7739019..9c6fafc 100644 --- a/tasks/RedHat/generic/disable-abrtd.yml +++ b/tasks/RedHat/generic/disable-abrtd.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/disable-abrt.yml" - - name: Disable abrtd include_tasks: disable-services.yml vars: diff --git a/tasks/RedHat/generic/disable-coredumps.yml b/tasks/RedHat/generic/disable-coredumps.yml index caa7a95..46d5e7a 100644 --- a/tasks/RedHat/generic/disable-coredumps.yml +++ b/tasks/RedHat/generic/disable-coredumps.yml @@ -1,12 +1,13 @@ --- -- debug: - msg: "imported RedHat/generic/disable-coredumps.yml" - -- name: Disable core file creation for all users +# Reasons for noqa: 1. Tabs can increase readability; +# 2. The example in man limits.conf is tab formatted; +# 3. It is difficult to replace tabs by spaces for entries for which their lenghts are not known +- name: Disable core file creation for all users # noqa no-tabs lineinfile: path: /etc/security/limits.d/99-sap.conf create: yes + mode: 0644 regexp: '^\*\s+{{ line_item }}\s+core\s.*' line: "*\t{{ line_item }}\tcore\t0" with_items: diff --git a/tasks/RedHat/generic/disable-firewalld.yml b/tasks/RedHat/generic/disable-firewalld.yml index 5b3f559..9714d7a 100644 --- a/tasks/RedHat/generic/disable-firewalld.yml +++ b/tasks/RedHat/generic/disable-firewalld.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/configure-firewalld.yml" - - name: Disable firewalld include_tasks: disable-services.yml vars: diff --git a/tasks/RedHat/generic/disable-kdump.yml b/tasks/RedHat/generic/disable-kdump.yml index c669dab..95e3bc9 100644 --- a/tasks/RedHat/generic/disable-kdump.yml +++ b/tasks/RedHat/generic/disable-kdump.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/disable-kdump.yml" - - name: Disable kdump include_tasks: disable-services.yml vars: diff --git a/tasks/RedHat/generic/disable-ksm.yml b/tasks/RedHat/generic/disable-ksm.yml index a4d11cd..6a1db90 100644 --- a/tasks/RedHat/generic/disable-ksm.yml +++ b/tasks/RedHat/generic/disable-ksm.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/disable-ksm.yml" - - name: Create file /etc/init.d/boot.local if it does not exist file: path: /etc/init.d/boot.local @@ -23,13 +20,19 @@ - name: Disable KSM on the running system shell: echo 0 > /sys/kernel/mm/ksm/run register: __sap_hana_preconfigure_register_disable_ksm -- debug: - var: __sap_hana_preconfigure_register_disable_ksm.stdout_lines, __sap_hana_preconfigure_register_disable_ksm.stderr_lines + changed_when: true + +# The following should not really be necessary: +#- name: Display the result of disabling KSM on the running system +# debug: +# var: __sap_hana_preconfigure_register_disable_ksm.stdout_lines, __sap_hana_preconfigure_register_disable_ksm.stderr_lines - name: Get status of KSM command: cat /sys/kernel/mm/ksm/run register: __sap_hana_preconfigure_register_ksm_status ignore_errors: true changed_when: false -- debug: + +- name: Display the status of KSM + debug: var: __sap_hana_preconfigure_register_ksm_status.stdout_lines, __sap_hana_preconfigure_register_ksm_status.stderr_lines diff --git a/tasks/RedHat/generic/disable-services.yml b/tasks/RedHat/generic/disable-services.yml index 8e7337d..3193506 100644 --- a/tasks/RedHat/generic/disable-services.yml +++ b/tasks/RedHat/generic/disable-services.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/disable-services.yml" - - name: Disable service {{ __sap_hana_preconfigure_packages_and_services[line_item].svc }} if if package {{ __sap_hana_preconfigure_packages_and_services[line_item].pkg }} is installed systemd: diff --git a/tasks/RedHat/generic/disable-thp.yml b/tasks/RedHat/generic/disable-thp.yml index 2621605..609bc4b 100644 --- a/tasks/RedHat/generic/disable-thp.yml +++ b/tasks/RedHat/generic/disable-thp.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/disable-thp.yml" - # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" - name: Disable transparent hugepages at boot time lineinfile: diff --git a/tasks/RedHat/generic/enable-tsx.yml b/tasks/RedHat/generic/enable-tsx.yml index e647cb2..846ffc2 100644 --- a/tasks/RedHat/generic/enable-tsx.yml +++ b/tasks/RedHat/generic/enable-tsx.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/enable-tsx.yml" - - name: Enable TSX at boot time command: /bin/true notify: __sap_hana_preconfigure_grubby_update_handler diff --git a/tasks/RedHat/generic/turn-off-auto-numa-balancing.yml b/tasks/RedHat/generic/turn-off-auto-numa-balancing.yml index 25e2164..92fcb55 100644 --- a/tasks/RedHat/generic/turn-off-auto-numa-balancing.yml +++ b/tasks/RedHat/generic/turn-off-auto-numa-balancing.yml @@ -1,8 +1,5 @@ --- -- debug: - msg: "imported RedHat/generic/turn-off-auto-numa-balancing.yml" - # can be configured by tuned profile sap-hana, entry "kernel.numa_balancing = 0" - name: Disable numad include_tasks: disable-services.yml diff --git a/tasks/RedHat/installation.yml b/tasks/RedHat/installation.yml index abd6084..e18e399 100644 --- a/tasks/RedHat/installation.yml +++ b/tasks/RedHat/installation.yml @@ -9,31 +9,34 @@ - block: # repos required for SAP HANA on RHEL 7 and RHEL 8: - - set_fact: + - name: Fill the variable for the generic list of required repos + set_fact: __sap_hana_preconfigure_fact_required_repos: "{{ lookup('vars','__sap_hana_preconfigure_req_repos_RedHat_' + ansible_distribution_version|string|replace (\".\", \"_\") + '_' + ansible_architecture) }}" - - set_fact: + - name: Construct valid argument list to the subscription-manager repos command + set_fact: __sap_hana_preconfigure_fact_required_repos_args: "{{ ['--enable='] | product(__sap_hana_preconfigure_fact_required_repos) | map('join') | list }}" - name: Enable required repositories command: "subscription-manager repos {{ __sap_hana_preconfigure_fact_required_repos_args | map('quote') | join(' ') }}" register: __sap_hana_preconfigure_register_subscription_enable_repos - - debug: + - name: Display the output of the subscription-manager repos --enable command + debug: var: __sap_hana_preconfigure_register_subscription_enable_repos when: sap_hana_preconfigure_enable_sap_hana_repos - name: Detect if the minor RHEL release is set - shell: subscription-manager release --show | awk '{print $NF}' + shell: set -o pipefail && subscription-manager release --show | awk '{print $NF}' register: __sap_hana_preconfigure_register_subscription_manager_release changed_when: false when: - sap_hana_preconfigure_set_minor_release - name: Set the minor RHEL release - shell: subscription-manager release --set="{{ ansible_distribution_version }}" + command: subscription-manager release --set="{{ ansible_distribution_version }}" when: - sap_hana_preconfigure_set_minor_release - __sap_hana_preconfigure_register_subscription_manager_release.stdout != ansible_distribution_version @@ -43,15 +46,20 @@ state: present name: "{{ sap_hana_preconfigure_packages }}" -- name: Get status of installed packages - yum: - name: "{{ sap_hana_preconfigure_packages }}" - register: __sap_hana_preconfigure_register_required_packages - ignore_errors: True - changed_when: false - -- debug: - var: __sap_hana_preconfigure_register_required_packages.results +# The package module is sufficient to guarantee that the required packages are installed. +# So there is no need to display the installed packages. +# This information can be displayed with an assert run or by running the role with an appropriate verbosity level +# +# - name: Get status of installed packages +# yum: +# name: "{{ sap_hana_preconfigure_packages }}" +# register: __sap_hana_preconfigure_register_required_packages +# ignore_errors: True +# changed_when: false +# +# - name: Display the list of required packages which are installed +# debug: +# var: __sap_hana_preconfigure_register_required_packages.results ### If this task fails, you need to enable the IBM PowerTools repository ### see https://www14.software.ibm.com/support/customercare/sas/f/lopdiags/home.html for details @@ -71,23 +79,29 @@ - ansible_architecture == "ppc64le" - sap_hana_preconfigure_add_ibm_power_repo|d(true) -- name: Install the IBM Service and Productivity Tools +# Reason for noqa: Both yum and dnf support "state: latest" +- name: Install the IBM Service and Productivity Tools # noqa package-latest package: state: latest name: "{{ __sap_hana_preconfigure_required_ppc64le }}" when: ansible_architecture == "ppc64le" -- name: Get the status of installed IBM Service and Productivity Tools - yum: - name: "{{ __sap_hana_preconfigure_required_ppc64le }}" - register: __sap_hana_preconfigure_register_required_ppc64le_packages - ignore_errors: True - changed_when: false - when: ansible_architecture == "ppc64le" - -- debug: - var: __sap_hana_preconfigure_register_required_ppc64le_packages.results - when: ansible_architecture == "ppc64le" +# The package module is sufficient to guarantee that the required packages are installed. +# So there is no need to display the installed packages. +# This information can be displayed with an assert run or by running the role with an appropriate verbosity level +# +#- name: Get the status of installed IBM Service and Productivity Tools +# yum: +# name: "{{ __sap_hana_preconfigure_required_ppc64le }}" +# register: __sap_hana_preconfigure_register_required_ppc64le_packages +# ignore_errors: True +# changed_when: false +# when: ansible_architecture == "ppc64le" +# +# - name: Get status of installed packages +# debug: +# var: __sap_hana_preconfigure_register_required_ppc64le_packages.results +# when: ansible_architecture == "ppc64le" - name: Ensure minimum required package versions are installed block: @@ -131,7 +145,8 @@ register: __sap_hana_preconfigure_register_minpkglist changed_when: no - - debug: + - name: Display the content of the minimum package list variable + debug: var: __sap_hana_preconfigure_register_minpkglist - name: Install minimum packages if required @@ -146,7 +161,8 @@ - sap_hana_preconfigure_min_package_check|bool - __sap_hana_preconfigure_min_pkgs|d([]) -- name: Ensure system is updated to the latest patchlevel +# Reason for noqa: Both yum and dnf support "state: latest" +- name: Ensure system is updated to the latest patchlevel # noqa package-latest package: state: latest name: "*" @@ -176,10 +192,12 @@ - ansible_os_family == 'RedHat' - ansible_distribution_version == '8.0' -- debug: +- name: Display the command for checking a reboot requirement + debug: var: __sap_hana_preconfigure_fact_needs_restarting_command -- name: Check if system needs to be restarted +# Reason for noqa: The command to be executed might contain pipes +- name: Check if system needs to be restarted # noqa command-instead-of-shell shell: "{{ __sap_hana_preconfigure_fact_needs_restarting_command }}" register: __sap_hana_preconfigure_register_needs_restarting ignore_errors: true @@ -188,7 +206,8 @@ warn: false check_mode: false -- debug: +- name: Display the output of the reboot requirement check + debug: var: __sap_hana_preconfigure_register_needs_restarting # Role sap-preconfigure is typically called right before this role. diff --git a/tasks/main.yml b/tasks/main.yml index c527a0c..0652e86 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,10 +1,10 @@ --- -- name: Show the role path +- name: Display the role path debug: var: role_path -- name: include os specific vars +- name: Include OS specific vars include_vars: '{{ item }}' with_first_found: - '{{ ansible_distribution }}_{{ ansible_distribution_version }}.yml' diff --git a/tasks/sapnote/2009879.yml b/tasks/sapnote/2009879.yml index c0b2183..d9924a8 100644 --- a/tasks/sapnote/2009879.yml +++ b/tasks/sapnote/2009879.yml @@ -28,7 +28,7 @@ ### Package installation is done in installation.yml -- name: Show note number and version +- name: Configure - Display SAP note number 2009879 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2009879$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2009879$') | first).version }}): SAP HANA Guidelines for R diff --git a/tasks/sapnote/2055470.yml b/tasks/sapnote/2055470.yml index d0378b2..7c385ca 100644 --- a/tasks/sapnote/2055470.yml +++ b/tasks/sapnote/2055470.yml @@ -13,7 +13,7 @@ - name: Perform configuration changes for ppc64le block: - - name: Show note number and version + - name: Configure - Display SAP note number 2055470 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2055470$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2055470$') | first).version }}): SAP HANA on POWER settings" @@ -34,7 +34,7 @@ when: not( (sap_hana_preconfigure_ppcle_mtu9000_if is undefined) or (sap_hana_preconfigure_ppcle_mtu9000_if is none) or - (sap_hana_preconfigure_ppcle_mtu9000_if | trim == '') + (sap_hana_preconfigure_ppcle_mtu9000_if | trim | length == 0) ) loop_control: loop_var: line_item @@ -49,7 +49,7 @@ when: not( (sap_hana_preconfigure_ppcle_tso_if is undefined) or (sap_hana_preconfigure_ppcle_tso_if is none) or - (sap_hana_preconfigure_ppcle_tso_if | trim == '') + (sap_hana_preconfigure_ppcle_tso_if | trim | length == 0) ) loop_control: loop_var: line_item @@ -59,6 +59,7 @@ lineinfile: path: /etc/sysctl.d/ibm_largesend.conf create: yes + mode: 0644 regexp: ^{{ line_item.name }}.* line: "{{ line_item.name }}={{ line_item.value }}" state: present diff --git a/tasks/sapnote/2292690.yml b/tasks/sapnote/2292690.yml index 7103a13..e16f9a4 100644 --- a/tasks/sapnote/2292690.yml +++ b/tasks/sapnote/2292690.yml @@ -1,7 +1,7 @@ --- # tasks file for sap-hana-preconfigure configuration -- name: Show note number and version +- name: Configure - Display SAP note number 2292690 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2292690$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2292690$') | first).version }}): SAP HANA settings for RHEL 7" @@ -27,9 +27,7 @@ - import_tasks: 2292690/07-disable-ksm.yml when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2292690_07|d(false) -# SELinux is already configured in role sap-preconfigure: -#- import_tasks: 2292690/08-disable-selinux.yml -# when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2292690_08|d(false) +# Step 8: SELinux is already configured in role sap-preconfigure. - import_tasks: 2292690/09-check-etc-sudoers.yml when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2292690_09|d(false) diff --git a/tasks/sapnote/2292690/01-assert-tuned.yml b/tasks/sapnote/2292690/01-assert-tuned.yml index 54059e3..86d05ac 100644 --- a/tasks/sapnote/2292690/01-assert-tuned.yml +++ b/tasks/sapnote/2292690/01-assert-tuned.yml @@ -1,6 +1,7 @@ --- -- debug: +- name: Assert 2292690-1 + debug: msg: "SAP note 2292690 Step 1: Configure tuned to use profile sap-hana" - import_tasks: ../../RedHat/generic/assert-tuned.yml diff --git a/tasks/sapnote/2292690/01-configure-tuned.yml b/tasks/sapnote/2292690/01-configure-tuned.yml index f313e3e..877f140 100644 --- a/tasks/sapnote/2292690/01-configure-tuned.yml +++ b/tasks/sapnote/2292690/01-configure-tuned.yml @@ -1,5 +1,6 @@ --- -- debug: +- name: Configure 2292690-1 + debug: msg: "SAP note 2292690 Step 1: Configure tuned to use profile sap-hana" - import_tasks: ../../RedHat/generic/configure-tuned.yml diff --git a/tasks/sapnote/2292690/02-assert-auto-numa-balancing.yml b/tasks/sapnote/2292690/02-assert-auto-numa-balancing.yml index 44bcdae..72af87d 100644 --- a/tasks/sapnote/2292690/02-assert-auto-numa-balancing.yml +++ b/tasks/sapnote/2292690/02-assert-auto-numa-balancing.yml @@ -1,6 +1,7 @@ --- # can be configured by tuned profile sap-hana, entry "kernel.numa_balancing = 0" -- debug: +- name: Assert 2292690-2 + debug: msg: "SAP note 2292690 Step 2: Turn off auto-numa balancing" - import_tasks: ../../RedHat/generic/assert-auto-numa-balancing.yml diff --git a/tasks/sapnote/2292690/02-turn-off-auto-numa-balancing.yml b/tasks/sapnote/2292690/02-turn-off-auto-numa-balancing.yml index 7614ef6..d6cb4de 100644 --- a/tasks/sapnote/2292690/02-turn-off-auto-numa-balancing.yml +++ b/tasks/sapnote/2292690/02-turn-off-auto-numa-balancing.yml @@ -1,6 +1,7 @@ --- # can be configured by tuned profile sap-hana, entry "kernel.numa_balancing = 0" -- debug: +- name: Configure 2292690-2 + debug: msg: "SAP note 2292690 Step 2: Turn off auto-numa balancing" - import_tasks: ../../RedHat/generic/turn-off-auto-numa-balancing.yml diff --git a/tasks/sapnote/2292690/03-assert-thp.yml b/tasks/sapnote/2292690/03-assert-thp.yml index 5a7d037..774cf25 100644 --- a/tasks/sapnote/2292690/03-assert-thp.yml +++ b/tasks/sapnote/2292690/03-assert-thp.yml @@ -1,6 +1,7 @@ --- # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" -- debug: +- name: Assert 2292690-3 + debug: msg: "SAP note 2292690 Step 3: Disable Transparent Hugepages (THP)" - import_tasks: ../../RedHat/generic/assert-thp.yml diff --git a/tasks/sapnote/2292690/03-disable-thp.yml b/tasks/sapnote/2292690/03-disable-thp.yml index 6de6d3f..2bc1e5d 100644 --- a/tasks/sapnote/2292690/03-disable-thp.yml +++ b/tasks/sapnote/2292690/03-disable-thp.yml @@ -1,6 +1,7 @@ --- # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" -- debug: +- name: Configure 2292690-3 + debug: msg: "SAP note 2292690 Step 3: Disable Transparent Hugepages (THP)" - import_tasks: ../../RedHat/generic/disable-thp.yml diff --git a/tasks/sapnote/2292690/04-assert-c-states-for-lower-latency.yml b/tasks/sapnote/2292690/04-assert-c-states-for-lower-latency.yml index 1ef35a1..6fab108 100644 --- a/tasks/sapnote/2292690/04-assert-c-states-for-lower-latency.yml +++ b/tasks/sapnote/2292690/04-assert-c-states-for-lower-latency.yml @@ -1,6 +1,7 @@ --- # can be configured by tuned profile sap-hana, entry "force_latency=70" -- debug: +- name: Assert 2292690-4 + debug: msg: "SAP note 2292690 Step 4: Configure C-States for lower latency (x86_64 platform only)" - import_tasks: ../../RedHat/generic/assert-c-states-for-lower-latency.yml diff --git a/tasks/sapnote/2292690/04-configure-c-states-for-lower-latency.yml b/tasks/sapnote/2292690/04-configure-c-states-for-lower-latency.yml index effa5d0..d11388f 100644 --- a/tasks/sapnote/2292690/04-configure-c-states-for-lower-latency.yml +++ b/tasks/sapnote/2292690/04-configure-c-states-for-lower-latency.yml @@ -1,6 +1,7 @@ --- # can be configured by tuned profile sap-hana, entry "force_latency=70" -- debug: +- name: Configure 2292690-4 + debug: msg: "SAP note 2292690 Step 4: Configure C-States for lower latency (x86_64 platform only)" - import_tasks: ../../RedHat/generic/configure-c-states-for-lower-latency.yml diff --git a/tasks/sapnote/2292690/05-assert-cpu-governor.yml b/tasks/sapnote/2292690/05-assert-cpu-governor.yml index c418fbb..3d59099 100644 --- a/tasks/sapnote/2292690/05-assert-cpu-governor.yml +++ b/tasks/sapnote/2292690/05-assert-cpu-governor.yml @@ -2,6 +2,7 @@ # can be configured by tuned profile sap-hana, entry "governor=performance" # in included tuned profile throughput-performance -- debug: +- name: Assert 2292690-5 + debug: msg: "SAP note 2292690 Step 5: Configure CPU Governor for performance (x86_64 platform only)" - import_tasks: ../../RedHat/generic/assert-cpu-governor-for-performance.yml diff --git a/tasks/sapnote/2292690/05-configure-cpu-governor.yml b/tasks/sapnote/2292690/05-configure-cpu-governor.yml index ff18d06..5523f0f 100644 --- a/tasks/sapnote/2292690/05-configure-cpu-governor.yml +++ b/tasks/sapnote/2292690/05-configure-cpu-governor.yml @@ -2,6 +2,7 @@ # can be configured by tuned profile sap-hana, entry "governor=performance" # in included tuned profile throughput-performance -- debug: +- name: Configure 2292690-5 + debug: msg: "SAP note 2292690 Step 5: Configure CPU Governor for performance (x86_64 platform only)" - import_tasks: ../../RedHat/generic/configure-cpu-governor-for-performance.yml diff --git a/tasks/sapnote/2292690/06-assert-epb.yml b/tasks/sapnote/2292690/06-assert-epb.yml index ef9327e..d35de32 100644 --- a/tasks/sapnote/2292690/06-assert-epb.yml +++ b/tasks/sapnote/2292690/06-assert-epb.yml @@ -2,6 +2,7 @@ # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" # in included tuned profile throughput-performance -- debug: +- name: Assert 2292690-6 + debug: msg: "SAP note 2292690 Step 6: Configure Energy Performance Bias (EPB, x86_64 platform only)" - import_tasks: ../../RedHat/generic/assert-epb.yml diff --git a/tasks/sapnote/2292690/06-configure-epb.yml b/tasks/sapnote/2292690/06-configure-epb.yml index 04cb107..1f4102d 100644 --- a/tasks/sapnote/2292690/06-configure-epb.yml +++ b/tasks/sapnote/2292690/06-configure-epb.yml @@ -2,6 +2,7 @@ # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" # in included tuned profile throughput-performance -- debug: +- name: Configure 2292690-6 + debug: msg: "SAP note 2292690 Step 6: Configure Energy Performance Bias (EPB, x86_64 platform only)" - import_tasks: ../../RedHat/generic/configure-epb.yml diff --git a/tasks/sapnote/2292690/07-assert-ksm.yml b/tasks/sapnote/2292690/07-assert-ksm.yml index 589743b..fd26dda 100644 --- a/tasks/sapnote/2292690/07-assert-ksm.yml +++ b/tasks/sapnote/2292690/07-assert-ksm.yml @@ -1,5 +1,6 @@ --- -- debug: +- name: Assert 2292690-7 + debug: msg: "SAP note 2292690 Step 7: Disable Kernel samepage merging (KSM)" - import_tasks: ../../RedHat/generic/assert-ksm.yml diff --git a/tasks/sapnote/2292690/07-disable-ksm.yml b/tasks/sapnote/2292690/07-disable-ksm.yml index db37d55..1740861 100644 --- a/tasks/sapnote/2292690/07-disable-ksm.yml +++ b/tasks/sapnote/2292690/07-disable-ksm.yml @@ -1,5 +1,6 @@ --- -- debug: +- name: Configure 2292690-7 + debug: msg: "SAP note 2292690 Step 7: Disable Kernel samepage merging (KSM)" - import_tasks: ../../RedHat/generic/disable-ksm.yml diff --git a/tasks/sapnote/2292690/08-assert-selinux.yml b/tasks/sapnote/2292690/08-assert-selinux.yml deleted file mode 100644 index 48931b8..0000000 --- a/tasks/sapnote/2292690/08-assert-selinux.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- - -- debug: - msg: "SAP note 2292690 Step 8: Disable SELinux" -- import_tasks: ../../RedHat/generic/assert-selinux.yml diff --git a/tasks/sapnote/2292690/08-disable-selinux.yml b/tasks/sapnote/2292690/08-disable-selinux.yml deleted file mode 100644 index ae1907a..0000000 --- a/tasks/sapnote/2292690/08-disable-selinux.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- - -- debug: - msg: "SAP note 2292690 Step 8: Disable SELinux" -- import_tasks: ../../RedHat/generic/disable-selinux.yml diff --git a/tasks/sapnote/2292690/09-assert-etc-sudoers.yml b/tasks/sapnote/2292690/09-assert-etc-sudoers.yml index 5e439f3..ce7b451 100644 --- a/tasks/sapnote/2292690/09-assert-etc-sudoers.yml +++ b/tasks/sapnote/2292690/09-assert-etc-sudoers.yml @@ -1,6 +1,7 @@ --- -- debug: +- name: Assert 2292690-9 + debug: msg: "SAP note 2292690 Step 9: Database startup fails with an error message - /etc/sudoers" - name: Get contents of /etc/sudoers diff --git a/tasks/sapnote/2292690/09-check-etc-sudoers.yml b/tasks/sapnote/2292690/09-check-etc-sudoers.yml index 1408abf..1b39b5d 100644 --- a/tasks/sapnote/2292690/09-check-etc-sudoers.yml +++ b/tasks/sapnote/2292690/09-check-etc-sudoers.yml @@ -1,7 +1,9 @@ --- -- debug: +- name: Configure 2292690-9 + debug: msg: "SAP note 2292690 Step 9: Database startup fails with an error message - /etc/sudoers" + - name: Ensure "Defaults requiretty" is not set in /etc/sudoers lineinfile: path: /etc/sudoers diff --git a/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml b/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml index ad96aed..f026997 100644 --- a/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml +++ b/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml @@ -1,7 +1,8 @@ --- #### Special recommendations for Power 8 -- debug: +- name: Assert 2292690-10 + debug: msg: "SAP note 2292690 Step 10: IBM EnergyScale for POWER8 Processor-Based Systems" - name: Check of package pseries-energy diff --git a/tasks/sapnote/2292690/10-ibm-energyscale.yml b/tasks/sapnote/2292690/10-ibm-energyscale.yml index 5fa784b..fa08431 100644 --- a/tasks/sapnote/2292690/10-ibm-energyscale.yml +++ b/tasks/sapnote/2292690/10-ibm-energyscale.yml @@ -1,8 +1,10 @@ --- #### Special recommendations for Power 8 -- debug: +- name: Configure 2292690-10 + debug: msg: "SAP note 2292690 Step 10: IBM EnergyScale for POWER8 Processor-Based Systems" + - name: ensure pseries-energy package is not installed yum: name: pseries-energy diff --git a/tasks/sapnote/2382421.yml b/tasks/sapnote/2382421.yml index f986304..1d0caa4 100644 --- a/tasks/sapnote/2382421.yml +++ b/tasks/sapnote/2382421.yml @@ -1,7 +1,7 @@ --- # SAP Note: 2382421 - Optimizing the Network Configuration on HANA- and OS-Level # -- name: Show note number and version +- name: Configure - Display SAP note number 2382421 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2382421$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2382421$') | first).version }}): Recommended network settings for SAP HANA" @@ -13,6 +13,7 @@ lineinfile: path: "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" create: yes + mode: 0644 regexp: ^{{ line_item.name }}.* line: "{{ line_item.name }}={{ line_item.value }}" state: present diff --git a/tasks/sapnote/2777782.yml b/tasks/sapnote/2777782.yml index b8694ef..bb08ac9 100644 --- a/tasks/sapnote/2777782.yml +++ b/tasks/sapnote/2777782.yml @@ -1,12 +1,12 @@ --- # tasks file for sap-hana-preconfigure configuration -- name: Show note number and version +- name: Configure - Display SAP note number 2777782 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2777782$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2777782$') | first).version }}): SAP HANA settings for RHEL 8" -# Note: SELinux is already configured in role sap-preconfigure. +# Step 1: SELinux is already configured in role sap-preconfigure. - import_tasks: 2777782/02-configure-tuned.yml when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2777782_02|d(false) diff --git a/tasks/sapnote/2777782/02-assert-tuned.yml b/tasks/sapnote/2777782/02-assert-tuned.yml index 9f9d69d..5b347a0 100644 --- a/tasks/sapnote/2777782/02-assert-tuned.yml +++ b/tasks/sapnote/2777782/02-assert-tuned.yml @@ -1,5 +1,6 @@ --- -- debug: +- name: Assert 2777782-2 + debug: msg: "SAP note 2777782 Step 2: Configure tuned to use profile sap-hana" - import_tasks: ../../RedHat/generic/assert-tuned.yml diff --git a/tasks/sapnote/2777782/02-configure-tuned.yml b/tasks/sapnote/2777782/02-configure-tuned.yml index 4875e21..4c8c3c2 100644 --- a/tasks/sapnote/2777782/02-configure-tuned.yml +++ b/tasks/sapnote/2777782/02-configure-tuned.yml @@ -1,5 +1,6 @@ --- -- debug: +- name: Configure 2777782-2 + debug: msg: "SAP note 2777782 Step 2: Configure tuned to use profile sap-hana" - import_tasks: ../../RedHat/generic/configure-tuned.yml diff --git a/tasks/sapnote/2777782/03-assert-abrt-coredumps-kdump.yml b/tasks/sapnote/2777782/03-assert-abrt-coredumps-kdump.yml index 3c8bbb1..bfcec35 100644 --- a/tasks/sapnote/2777782/03-assert-abrt-coredumps-kdump.yml +++ b/tasks/sapnote/2777782/03-assert-abrt-coredumps-kdump.yml @@ -1,6 +1,7 @@ --- -- debug: +- name: Assert 2777782-3 + debug: msg: "SAP note 2777782 Step 3: Disable ABRT, core dumps, and kdump" - import_tasks: ../../RedHat/generic/assert-abrtd.yml - import_tasks: ../../RedHat/generic/assert-abrt-ccpp.yml diff --git a/tasks/sapnote/2777782/03-disable-abrt-coredumps-kdump.yml b/tasks/sapnote/2777782/03-disable-abrt-coredumps-kdump.yml index aab4330..7a8b38f 100644 --- a/tasks/sapnote/2777782/03-disable-abrt-coredumps-kdump.yml +++ b/tasks/sapnote/2777782/03-disable-abrt-coredumps-kdump.yml @@ -1,6 +1,7 @@ --- -- debug: +- name: Configure 2777782-3 + debug: msg: "SAP note 2777782 Step 3: Disable ABRT, core dumps, and kdump" - import_tasks: ../../RedHat/generic/disable-abrtd.yml - import_tasks: ../../RedHat/generic/disable-abrt-ccpp.yml diff --git a/tasks/sapnote/2777782/04-assert-auto-numa-balancing.yml b/tasks/sapnote/2777782/04-assert-auto-numa-balancing.yml index e11f720..04d5295 100644 --- a/tasks/sapnote/2777782/04-assert-auto-numa-balancing.yml +++ b/tasks/sapnote/2777782/04-assert-auto-numa-balancing.yml @@ -1,6 +1,7 @@ --- # can be configured by tuned profile sap-hana, entry "kernel.numa_balancing = 0" -- debug: +- name: Assert 2777782-4 + debug: msg: "SAP note 2777782 Step 4: Turn off auto-numa balancing" - import_tasks: ../../RedHat/generic/assert-auto-numa-balancing.yml diff --git a/tasks/sapnote/2777782/04-turn-off-auto-numa-balancing.yml b/tasks/sapnote/2777782/04-turn-off-auto-numa-balancing.yml index 707692c..987943f 100644 --- a/tasks/sapnote/2777782/04-turn-off-auto-numa-balancing.yml +++ b/tasks/sapnote/2777782/04-turn-off-auto-numa-balancing.yml @@ -1,6 +1,7 @@ --- # can be configured by tuned profile sap-hana, entry "kernel.numa_balancing = 0" -- debug: +- name: Configure 2777782-4 + debug: msg: "SAP note 2777782 Step 4: Turn off auto-numa balancing" - import_tasks: ../../RedHat/generic/turn-off-auto-numa-balancing.yml diff --git a/tasks/sapnote/2777782/05-assert-thp.yml b/tasks/sapnote/2777782/05-assert-thp.yml index 7bc4cbd..b1f4c21 100644 --- a/tasks/sapnote/2777782/05-assert-thp.yml +++ b/tasks/sapnote/2777782/05-assert-thp.yml @@ -1,6 +1,7 @@ --- # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" -- debug: +- name: Assert 2777782-5 + debug: msg: "SAP note 2777782 Step 5: Disable Transparent Hugepages (THP)" - import_tasks: ../../RedHat/generic/assert-thp.yml diff --git a/tasks/sapnote/2777782/05-disable-thp.yml b/tasks/sapnote/2777782/05-disable-thp.yml index 7167148..3ff308d 100644 --- a/tasks/sapnote/2777782/05-disable-thp.yml +++ b/tasks/sapnote/2777782/05-disable-thp.yml @@ -1,6 +1,7 @@ --- # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" -- debug: +- name: Configure 2777782-5 + debug: msg: "SAP note 2777782 Step 5: Disable Transparent Hugepages (THP)" - import_tasks: ../../RedHat/generic/disable-thp.yml diff --git a/tasks/sapnote/2777782/06-assert-c-states-for-lower-latency.yml b/tasks/sapnote/2777782/06-assert-c-states-for-lower-latency.yml index 0afa42e..bb0e7b8 100644 --- a/tasks/sapnote/2777782/06-assert-c-states-for-lower-latency.yml +++ b/tasks/sapnote/2777782/06-assert-c-states-for-lower-latency.yml @@ -1,6 +1,7 @@ --- # can be configured by tuned profile sap-hana, entry "force_latency=70" -- debug: +- name: Assert 2777782-6 + debug: msg: "SAP note 2777782 Step 6: Configure C-States for lower latency (x86_64 platform only)" - import_tasks: ../../RedHat/generic/assert-c-states-for-lower-latency.yml diff --git a/tasks/sapnote/2777782/06-configure-c-states-for-lower-latency.yml b/tasks/sapnote/2777782/06-configure-c-states-for-lower-latency.yml index b7b1217..3c9f5f5 100644 --- a/tasks/sapnote/2777782/06-configure-c-states-for-lower-latency.yml +++ b/tasks/sapnote/2777782/06-configure-c-states-for-lower-latency.yml @@ -1,6 +1,7 @@ --- # can be configured by tuned profile sap-hana, entry "force_latency=70" -- debug: +- name: Configure 2777782-6 + debug: msg: "SAP note 2777782 Step 6: Configure C-States for lower latency (x86_64 platform only)" - import_tasks: ../../RedHat/generic/configure-c-states-for-lower-latency.yml diff --git a/tasks/sapnote/2777782/07-assert-cpu-governor.yml b/tasks/sapnote/2777782/07-assert-cpu-governor.yml index 99cfd5e..28d5201 100644 --- a/tasks/sapnote/2777782/07-assert-cpu-governor.yml +++ b/tasks/sapnote/2777782/07-assert-cpu-governor.yml @@ -2,6 +2,7 @@ # can be configured by tuned profile sap-hana, entry "governor=performance" # in included tuned profile throughput-performance -- debug: +- name: Assert 2777782-7 + debug: msg: "SAP note 2777782 Step 7: Configure CPU Governor for performance (x86_64 platform only)" - import_tasks: ../../RedHat/generic/assert-cpu-governor-for-performance.yml diff --git a/tasks/sapnote/2777782/07-configure-cpu-governor.yml b/tasks/sapnote/2777782/07-configure-cpu-governor.yml index 38335b1..352da23 100644 --- a/tasks/sapnote/2777782/07-configure-cpu-governor.yml +++ b/tasks/sapnote/2777782/07-configure-cpu-governor.yml @@ -2,6 +2,7 @@ # can be configured by tuned profile sap-hana, entry "governor=performance" # in included tuned profile throughput-performance -- debug: +- name: Configure 2777782-7 + debug: msg: "SAP note 2777782 Step 7: Configure CPU Governor for performance (x86_64 platform only)" - import_tasks: ../../RedHat/generic/configure-cpu-governor-for-performance.yml diff --git a/tasks/sapnote/2777782/08-assert-epb.yml b/tasks/sapnote/2777782/08-assert-epb.yml index 0daf2f7..ef62d9d 100644 --- a/tasks/sapnote/2777782/08-assert-epb.yml +++ b/tasks/sapnote/2777782/08-assert-epb.yml @@ -2,6 +2,7 @@ # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" # in included tuned profile throughput-performance -- debug: +- name: Assert 2777782-8 + debug: msg: "SAP note 2777782 Step 8: Configure Energy Performance Bias (EPB, x86_64 platform only)" - import_tasks: ../../RedHat/generic/assert-epb.yml diff --git a/tasks/sapnote/2777782/08-configure-epb.yml b/tasks/sapnote/2777782/08-configure-epb.yml index 3d5692e..0d8779e 100644 --- a/tasks/sapnote/2777782/08-configure-epb.yml +++ b/tasks/sapnote/2777782/08-configure-epb.yml @@ -2,6 +2,7 @@ # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" # in included tuned profile throughput-performance -- debug: +- name: Configure 2777782-8 + debug: msg: "SAP note 2777782 Step 8: Configure Energy Performance Bias (EPB, x86_64 platform only)" - import_tasks: ../../RedHat/generic/configure-epb.yml diff --git a/tasks/sapnote/2777782/09-assert-ksm.yml b/tasks/sapnote/2777782/09-assert-ksm.yml index c661ef7..3f4b06e 100644 --- a/tasks/sapnote/2777782/09-assert-ksm.yml +++ b/tasks/sapnote/2777782/09-assert-ksm.yml @@ -1,5 +1,6 @@ --- -- debug: +- name: Assert 2777782-9 + debug: msg: "SAP note 2777782 Step 9: Disable Kernel samepage merging (KSM)" - import_tasks: ../../RedHat/generic/assert-ksm.yml diff --git a/tasks/sapnote/2777782/09-disable-ksm.yml b/tasks/sapnote/2777782/09-disable-ksm.yml index 1ae236f..8512047 100644 --- a/tasks/sapnote/2777782/09-disable-ksm.yml +++ b/tasks/sapnote/2777782/09-disable-ksm.yml @@ -1,5 +1,6 @@ --- -- debug: +- name: Configure 2777782-9 + debug: msg: "SAP note 2777782 Step 9: Disable Kernel samepage merging (KSM)" - import_tasks: ../../RedHat/generic/disable-ksm.yml diff --git a/tasks/sapnote/2777782/10-assert-pidmax.yml b/tasks/sapnote/2777782/10-assert-pidmax.yml index dc5fcb8..56f2d19 100644 --- a/tasks/sapnote/2777782/10-assert-pidmax.yml +++ b/tasks/sapnote/2777782/10-assert-pidmax.yml @@ -1,6 +1,7 @@ --- -- debug: +- name: Assert 2777782-10 + debug: msg: "SAP note 2777782 Step 10: Increase kernel.pid_max" - name: Get info about file /etc/sysctl.d/sap.conf diff --git a/tasks/sapnote/2777782/10-increase-pidmax.yml b/tasks/sapnote/2777782/10-increase-pidmax.yml index 3b5efe5..0a90449 100644 --- a/tasks/sapnote/2777782/10-increase-pidmax.yml +++ b/tasks/sapnote/2777782/10-increase-pidmax.yml @@ -1,12 +1,14 @@ --- -- debug: +- name: Configure 2777782-10 + debug: msg: "SAP note 2777782 Step 10: Increase kernel.pid_max" - name: Set kernel parameter kernel.pid_max to 4194304 lineinfile: path: /etc/sysctl.d/sap.conf create: yes + mode: 0644 regexp: ^kernel.pid_max.* line: 'kernel.pid_max=4194304' state: present @@ -14,6 +16,7 @@ - name: Reload kernel parameters from file '/etc/sysctl.d/sap.conf' command: sysctl -p /etc/sysctl.d/sap.conf register: __sap_hana_preconfigure_register_sap_conf_sysctl_p_output + changed_when: true - name: Print kernel parameters after setting kernel.pid_max debug: diff --git a/tasks/sapnote/2777782/11-assert-tsx.yml b/tasks/sapnote/2777782/11-assert-tsx.yml index b481a5e..8055ba5 100644 --- a/tasks/sapnote/2777782/11-assert-tsx.yml +++ b/tasks/sapnote/2777782/11-assert-tsx.yml @@ -1,5 +1,6 @@ --- -- debug: +- name: Assert 2777782-11 + debug: msg: "SAP note 2777782 Step 11: Enable TSX (Intel Transactional Synchronization Extensions)" - import_tasks: ../../RedHat/generic/assert-tsx.yml diff --git a/tasks/sapnote/2777782/11-enable-tsx.yml b/tasks/sapnote/2777782/11-enable-tsx.yml index f6a365e..2f0e025 100644 --- a/tasks/sapnote/2777782/11-enable-tsx.yml +++ b/tasks/sapnote/2777782/11-enable-tsx.yml @@ -1,5 +1,6 @@ --- -- debug: +- name: Configure 2777782-11 + debug: msg: "SAP note 2777782 Step 11: Enable TSX (Intel Transactional Synchronization Extensions)" - import_tasks: ../../RedHat/generic/enable-tsx.yml diff --git a/tasks/sapnote/3024346.yml b/tasks/sapnote/3024346.yml index b0c6ad7..d7cb882 100644 --- a/tasks/sapnote/3024346.yml +++ b/tasks/sapnote/3024346.yml @@ -1,18 +1,19 @@ --- # SAP Note: 3024346 - Linux Kernel Settings for NetApp NFS # -- name: Show note number and version +- name: Configure - Display SAP note number 3024346 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^3024346$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^3024346$') | first).version }}): Linux kernel settings for NetApp NFS" -- name: Set kernel tunables as per SAP note 3024346 +- name: Set kernel tunables for NetApp NFS as per SAP note 3024346 block: - name: Modify entries in file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' lineinfile: path: "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" create: yes + mode: 0644 regexp: ^{{ line_item.name }}.* line: "{{ line_item.name }}={{ line_item.value }}" state: present @@ -24,7 +25,7 @@ command: sysctl -p "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" register: __sap_hana_preconfigure_register_netapp_sysctl_p_output - - name: Print kernel parameters for NetApp NFS + - name: Display kernel parameters for NetApp NFS debug: var: __sap_hana_preconfigure_register_netapp_sysctl_p_output.stdout_lines @@ -32,6 +33,7 @@ lineinfile: path: /etc/modprobe.d/sunrpc.conf create: yes + mode: 0644 regexp: '^options sunrpc tcp_max_slot_table_entries' line: options sunrpc tcp_max_slot_table_entries=128 when: sap_hana_preconfigure_use_netapp_settings_nfsv3 diff --git a/tasks/sapnote/assert-2009879.yml b/tasks/sapnote/assert-2009879.yml index 8478cbd..74be2d1 100644 --- a/tasks/sapnote/assert-2009879.yml +++ b/tasks/sapnote/assert-2009879.yml @@ -7,14 +7,11 @@ # We include the release specific stuff here # -- name: Show note number and version +- name: Assert - Display SAP note number 2009879 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2009879$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2009879$') | first).version }}): SAP HANA Guidelines for RHEL 7 (pdf)" -- debug: - msg: "sapnote/assert-2009879.yml" - ### Package installation is done in installation.yml - include_tasks: assert-2009879_{{ ansible_distribution_major_version }}.yml diff --git a/tasks/sapnote/assert-2009879_7.yml b/tasks/sapnote/assert-2009879_7.yml index 1422bd8..9bb4da0 100644 --- a/tasks/sapnote/assert-2009879_7.yml +++ b/tasks/sapnote/assert-2009879_7.yml @@ -9,9 +9,6 @@ # See comments # -- debug: - msg: "sapnote/assert-2009879_7.yml" - ### 3.1 - Basic OS installation is a prerequisite ### 3.2 - Additional Package installation is done in the installation.yml file ### 3.3 - Hostname - is an SAP generic setting, already done with SAP Note 2002167 (sap-preconfigure) diff --git a/tasks/sapnote/assert-2055470.yml b/tasks/sapnote/assert-2055470.yml index 0a0362f..3adcb0c 100644 --- a/tasks/sapnote/assert-2055470.yml +++ b/tasks/sapnote/assert-2055470.yml @@ -11,15 +11,13 @@ # Network_Configuration_for_HANA_Workloads_on_IBM_Power_Servers_V4.pdf - block: - - name: Show note number and version + - name: Assert - Display SAP note number 2055470 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2055470$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2055470$') | first).version }}): SAP HANA on POWER settings" - - debug: - msg: "sapnote/assert-2055470.yml" - - - debug: + - name: Display an info about checking the MTU size + debug: msg: "WARN: Checking of MTU size==9000 on all interfaces not yet implemented. Please check manually!" #- name: ensure MTU size is 9000 on all interfaces @@ -43,7 +41,8 @@ # loop_var: line_item ## This only works if interfacename=device name, otherwise it fails - - debug: + - name: Display an info about checking largesend options + debug: msg: "WARN: Checking of largesend options of interface {{ sap_hana_preconfigure_ppcle_tso_if }} not yet implemented. Please check manually!" #- name: add largesend options to interface @@ -80,7 +79,7 @@ when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2055470|d(false) - name: Get and assert kernel tunables for ppc64le - include_tasks: ../RedHat/generic/sapnote-2055470-loop-block.yml + include_tasks: ../RedHat/generic/assert-2055470-loop-block.yml loop: "{{ sap_hana_preconfigure_kernel_parameters_ppc64le }}" loop_control: loop_var: line_item diff --git a/tasks/sapnote/assert-2292690.yml b/tasks/sapnote/assert-2292690.yml index c2c64c6..60d1f7e 100644 --- a/tasks/sapnote/assert-2292690.yml +++ b/tasks/sapnote/assert-2292690.yml @@ -1,14 +1,11 @@ --- # tasks file for sap-hana-preconfigure configuration -- name: Show note number and version +- name: Assert - Display SAP note number 2292690 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2292690$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2292690$') | first).version }}): SAP HANA settings for RHEL 7" -- debug: - msg: "sapnote/assert-2292690.yml" - - import_tasks: 2292690/01-assert-tuned.yml when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2292690_01|d(false) @@ -30,9 +27,7 @@ - import_tasks: 2292690/07-assert-ksm.yml when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2292690_07|d(false) -# SELinux is already configured in role sap-preconfigure: -#- import_tasks: 2292690/08-assert-selinux.yml -# when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2292690_08|d(false) +# Step 8: SELinux is already asserted in role sap-preconfigure. - import_tasks: 2292690/09-assert-etc-sudoers.yml when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2292690_09|d(false) diff --git a/tasks/sapnote/assert-2382421.yml b/tasks/sapnote/assert-2382421.yml index da2e88f..cd593a7 100644 --- a/tasks/sapnote/assert-2382421.yml +++ b/tasks/sapnote/assert-2382421.yml @@ -3,14 +3,11 @@ # SAP Note: 2382421 - Optimizing the Network Configuration on HANA- and OS-Level # -- name: Show note number and version +- name: Assert - Display SAP note number 2382421 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2382421$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2382421$') | first).version }}): Recommended network settings for SAP HANA" -- debug: - msg: "sapnote/assert-2382421.yml" - - block: - name: Get info about file {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} stat: @@ -35,7 +32,7 @@ when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2382421|d(false) - name: Get and assert kernel tunables - include_tasks: ../RedHat/generic/sapnote-2382421-loop-block.yml + include_tasks: ../RedHat/generic/assert-2382421-loop-block.yml loop: "{{ __sap_hana_preconfigure_kernel_parameters_default }}" loop_control: loop_var: line_item diff --git a/tasks/sapnote/assert-2777782.yml b/tasks/sapnote/assert-2777782.yml index 0b6f99e..a58c195 100644 --- a/tasks/sapnote/assert-2777782.yml +++ b/tasks/sapnote/assert-2777782.yml @@ -1,15 +1,12 @@ --- # tasks file for sap-hana-preconfigure configuration -- name: Show note number and version +- name: Assert - Display SAP note number 2777782 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2777782$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2777782$') | first).version }}): SAP HANA settings for RHEL 8" -- debug: - msg: "sapnote/assert-2777782.yml" - -# Note: SELinux is already configured in role sap-preconfigure. +# Step 1: SELinux is already asserted in role sap-preconfigure. - import_tasks: 2777782/02-assert-tuned.yml when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2777782_02|d(false) diff --git a/tasks/sapnote/assert-3024346.yml b/tasks/sapnote/assert-3024346.yml index 34c3834..0b82433 100644 --- a/tasks/sapnote/assert-3024346.yml +++ b/tasks/sapnote/assert-3024346.yml @@ -2,14 +2,11 @@ # SAP Note: 3024346 - Linux Kernel Settings for NetApp NFS # -- name: Show note number and version +- name: Assert - Display SAP note number 3024346 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^3024346$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^3024346$') | first).version }}): Linux kernel settings for NetApp NFS" -- debug: - msg: "sapnote/assert-3024346.yml" - - block: - name: Get info about file {{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }} stat: @@ -36,7 +33,7 @@ - sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_3024346|d(false) - name: Get and assert kernel tunables for NetApp NFS - include_tasks: ../RedHat/generic/sapnote-3024346-loop-block.yml + include_tasks: ../RedHat/generic/assert-3024346-loop-block.yml loop: "{{ __sap_hana_preconfigure_kernel_parameters_netapp_nfs }}" loop_control: loop_var: line_item From 582305e409d843a3be908aba5e1dd8a76621b5e2 Mon Sep 17 00:00:00 2001 From: Bernd Finger <> Date: Thu, 25 Nov 2021 22:09:33 +0100 Subject: [PATCH 2/4] Solved issues #210 and #211 --- .ansible-lint | 29 +++---- .yamllint.yml | 21 +++++ defaults/main.yml | 18 ++--- meta/main.yml | 5 +- meta/runtime.yml | 2 + tasks/RedHat/assert-configuration.yml | 8 +- tasks/RedHat/assert-installation.yml | 52 ++++++------- tasks/RedHat/configuration.yml | 14 +--- .../generic/assert-2055470-loop-block.yml | 8 +- .../generic/assert-2382421-loop-block.yml | 8 +- .../generic/assert-3024346-loop-block.yml | 8 +- .../assert-c-states-for-lower-latency.yml | 4 +- .../assert-cpu-governor-for-performance.yml | 2 +- tasks/RedHat/generic/assert-ksm.yml | 4 +- tasks/RedHat/generic/assert-thp.yml | 4 +- tasks/RedHat/generic/assert-tsx.yml | 8 +- tasks/RedHat/generic/assert-tuned.yml | 10 +-- tasks/RedHat/generic/configure-epb.yml | 2 +- tasks/RedHat/generic/disable-ksm.yml | 9 +-- tasks/RedHat/generic/disable-thp.yml | 2 +- tasks/RedHat/installation.yml | 76 +++++++++--------- tasks/sapnote/2009879.yml | 12 +-- tasks/sapnote/2009879_7.yml | 24 +++--- tasks/sapnote/2055470.yml | 8 +- tasks/sapnote/2292690.yml | 2 - tasks/sapnote/2382421.yml | 34 ++++---- tasks/sapnote/2777782.yml | 5 +- tasks/sapnote/2777782/01-assert-selinux.yml | 9 +++ .../sapnote/2777782/01-configure-selinux.yml | 9 +++ tasks/sapnote/2777782/10-assert-pidmax.yml | 56 +------------- tasks/sapnote/2777782/10-increase-pidmax.yml | 20 +---- tasks/sapnote/3024346.yml | 50 ++++++------ tasks/sapnote/assert-2009879.yml | 2 +- tasks/sapnote/assert-2009879_7.yml | 38 ++++----- tasks/sapnote/assert-2055470.yml | 42 +++++----- tasks/sapnote/assert-2292690.yml | 2 - tasks/sapnote/assert-2777782.yml | 5 +- tests/inventory | 2 - ...ana-preconfigure-issue-118-assert-vars.yml | 30 -------- ...sap-hana-preconfigure-issue-118-assert.yml | 19 ----- ...-preconfigure-issue-118-prepare-test-1.yml | 6 -- ...p-hana-preconfigure-issue-118-run-tests.sh | 34 -------- .../sap-hana-preconfigure-issue-118-test.yml | 8 -- ...sap-hana-preconfigure-issue-128-assert.yml | 44 ----------- ...-preconfigure-issue-128-prepare-test-1.yml | 6 -- ...p-hana-preconfigure-issue-128-run-tests.sh | 60 --------------- .../sap-hana-preconfigure-issue-128-test.yml | 10 --- ....py => run-sap-hana-preconfigure-tests.py} | 2 +- ...ap-hana-preconfigure-default-settings.yml} | 0 ...gure-sapnote-2777782-01-prepare-test-1.yml | 6 -- ...econfigure-sapnote-2777782-01-run-tests.sh | 58 -------------- ...a-preconfigure-sapnote-2777782-01-test.yml | 11 --- ...econfigure-sapnote-2777782-02-run-tests.sh | 53 ------------- ...a-preconfigure-sapnote-2777782-02-test.yml | 11 --- ...econfigure-sapnote-2777782-03-run-tests.sh | 53 ------------- ...a-preconfigure-sapnote-2777782-03-test.yml | 11 --- ...econfigure-sapnote-2777782-04-run-tests.sh | 53 ------------- ...a-preconfigure-sapnote-2777782-04-test.yml | 11 --- ...econfigure-sapnote-2777782-05-run-tests.sh | 53 ------------- ...a-preconfigure-sapnote-2777782-05-test.yml | 11 --- ...econfigure-sapnote-2777782-06-run-tests.sh | 53 ------------- ...a-preconfigure-sapnote-2777782-06-test.yml | 11 --- ...econfigure-sapnote-2777782-07-run-tests.sh | 53 ------------- ...a-preconfigure-sapnote-2777782-07-test.yml | 11 --- ...econfigure-sapnote-2777782-08-run-tests.sh | 53 ------------- ...a-preconfigure-sapnote-2777782-08-test.yml | 11 --- ...econfigure-sapnote-2777782-09-run-tests.sh | 53 ------------- ...a-preconfigure-sapnote-2777782-09-test.yml | 11 --- ...econfigure-sapnote-2777782-10-run-tests.sh | 53 ------------- ...a-preconfigure-sapnote-2777782-10-test.yml | 11 --- tests/test.yml | 5 -- vars/RedHat_7.yml | 77 +++++++++---------- vars/RedHat_8.yml | 74 +++++++++--------- vars/RedHat_9.yml | 28 +++---- 74 files changed, 368 insertions(+), 1300 deletions(-) create mode 100644 .yamllint.yml create mode 100644 meta/runtime.yml create mode 100644 tasks/sapnote/2777782/01-assert-selinux.yml create mode 100644 tasks/sapnote/2777782/01-configure-selinux.yml delete mode 100644 tests/inventory delete mode 100644 tests/issues/118/sap-hana-preconfigure-issue-118-assert-vars.yml delete mode 100644 tests/issues/118/sap-hana-preconfigure-issue-118-assert.yml delete mode 100644 tests/issues/118/sap-hana-preconfigure-issue-118-prepare-test-1.yml delete mode 100755 tests/issues/118/sap-hana-preconfigure-issue-118-run-tests.sh delete mode 100644 tests/issues/118/sap-hana-preconfigure-issue-118-test.yml delete mode 100644 tests/issues/128/sap-hana-preconfigure-issue-128-assert.yml delete mode 100644 tests/issues/128/sap-hana-preconfigure-issue-128-prepare-test-1.yml delete mode 100755 tests/issues/128/sap-hana-preconfigure-issue-128-run-tests.sh delete mode 100644 tests/issues/128/sap-hana-preconfigure-issue-128-test.yml rename tests/{run-tests.py => run-sap-hana-preconfigure-tests.py} (99%) rename tests/{default-settings.yml => sap-hana-preconfigure-default-settings.yml} (100%) delete mode 100644 tests/sapnote/2777782/01/sap-hana-preconfigure-sapnote-2777782-01-prepare-test-1.yml delete mode 100755 tests/sapnote/2777782/01/sap-hana-preconfigure-sapnote-2777782-01-run-tests.sh delete mode 100644 tests/sapnote/2777782/01/sap-hana-preconfigure-sapnote-2777782-01-test.yml delete mode 100755 tests/sapnote/2777782/02/sap-hana-preconfigure-sapnote-2777782-02-run-tests.sh delete mode 100644 tests/sapnote/2777782/02/sap-hana-preconfigure-sapnote-2777782-02-test.yml delete mode 100755 tests/sapnote/2777782/03/sap-hana-preconfigure-sapnote-2777782-03-run-tests.sh delete mode 100644 tests/sapnote/2777782/03/sap-hana-preconfigure-sapnote-2777782-03-test.yml delete mode 100755 tests/sapnote/2777782/04/sap-hana-preconfigure-sapnote-2777782-04-run-tests.sh delete mode 100644 tests/sapnote/2777782/04/sap-hana-preconfigure-sapnote-2777782-04-test.yml delete mode 100755 tests/sapnote/2777782/05/sap-hana-preconfigure-sapnote-2777782-05-run-tests.sh delete mode 100644 tests/sapnote/2777782/05/sap-hana-preconfigure-sapnote-2777782-05-test.yml delete mode 100755 tests/sapnote/2777782/06/sap-hana-preconfigure-sapnote-2777782-06-run-tests.sh delete mode 100644 tests/sapnote/2777782/06/sap-hana-preconfigure-sapnote-2777782-06-test.yml delete mode 100755 tests/sapnote/2777782/07/sap-hana-preconfigure-sapnote-2777782-07-run-tests.sh delete mode 100644 tests/sapnote/2777782/07/sap-hana-preconfigure-sapnote-2777782-07-test.yml delete mode 100755 tests/sapnote/2777782/08/sap-hana-preconfigure-sapnote-2777782-08-run-tests.sh delete mode 100644 tests/sapnote/2777782/08/sap-hana-preconfigure-sapnote-2777782-08-test.yml delete mode 100755 tests/sapnote/2777782/09/sap-hana-preconfigure-sapnote-2777782-09-run-tests.sh delete mode 100644 tests/sapnote/2777782/09/sap-hana-preconfigure-sapnote-2777782-09-test.yml delete mode 100755 tests/sapnote/2777782/10/sap-hana-preconfigure-sapnote-2777782-10-run-tests.sh delete mode 100644 tests/sapnote/2777782/10/sap-hana-preconfigure-sapnote-2777782-10-test.yml delete mode 100644 tests/test.yml diff --git a/.ansible-lint b/.ansible-lint index 076d985..05333ef 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,19 +1,20 @@ +--- skip_list: # We do not intend to change the role name - role-name + - ignore-errors # We use ignore_errors for all the assert tasks, which should be acceptable exclude_paths: -- tasks/SLES -- tasks/SLES15 -- tasks/sapnote/1275776 # SLES - sapconf, saptune, etc -- tasks/sapnote/1944799 # SLES - HANA install and config guidelines -- tasks/sapnote/2013638.yml # RHEL 6.5 - OS settings -- tasks/sapnote/2136965.yml # RHEL 6.6 - OS settings -- tasks/sapnote/2247020.yml # RHEL 6.7 - OS settings -- tasks/sapnote/2578899 # SLES 15 - installation -- tasks/sapnote/2684254 # SLES 15 - OS settings for HANA -- vars/RedHat_6.5.yml -- vars/RedHat_6.6.yml -- vars/RedHat_6.7.yml -- vars/SLES_15.yml - + - tasks/SLES + - tasks/SLES15 + - tasks/sapnote/1275776 # SLES - sapconf, saptune, etc + - tasks/sapnote/1944799 # SLES - HANA install and config guidelines + - tasks/sapnote/2013638.yml # RHEL 6.5 - OS settings + - tasks/sapnote/2136965.yml # RHEL 6.6 - OS settings + - tasks/sapnote/2247020.yml # RHEL 6.7 - OS settings + - tasks/sapnote/2578899 # SLES 15 - installation + - tasks/sapnote/2684254 # SLES 15 - OS settings for HANA + - vars/RedHat_6.5.yml + - vars/RedHat_6.6.yml + - vars/RedHat_6.7.yml + - vars/SLES_15.yml diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..57ef427 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,21 @@ +--- +# Based on ansible-lint config +extends: default + +rules: + braces: {max-spaces-inside: 1, level: error} + brackets: {max-spaces-inside: 1, level: error} +# colons: {max-spaces-after: -1, level: error} +# commas: {max-spaces-after: -1, level: error} + comments: disable + comments-indentation: disable +# document-start: disable +# empty-lines: {max: 3, level: error} +# hyphens: {level: error} +# indentation: disable +# key-duplicates: enable + line-length: disable +# new-line-at-end-of-file: disable +# new-lines: {type: unix} +# trailing-spaces: disable + truthy: disable diff --git a/defaults/main.yml b/defaults/main.yml index f971f04..01feded 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- ###################################### -# HANA Default Variables +# HANA Default Variables # # Want extensive debugging @@ -46,19 +46,19 @@ sap_hana_preconfigure_supported_rhel_minor_releases: "{{ __sap_hana_preconfigure sap_hana_preconfigure_enable_sap_hana_repos: no # Change one or more of the following in case you want different repos to be enabled than defined in vars. -sap_hana_preconfigure_req_repos_RedHat_7_x86_64: "{{ __sap_hana_preconfigure_req_repos_RedHat_7_x86_64 }}" -sap_hana_preconfigure_req_repos_RedHat_7_ppc64le: "{{ __sap_hana_preconfigure_req_repos_RedHat_7_ppc64le }}" -sap_hana_preconfigure_req_repos_RedHat_8_x86_64: "{{ __sap_hana_preconfigure_req_repos_RedHat_8_x86_64 }}" -sap_hana_preconfigure_req_repos_RedHat_8_ppc64le: "{{ __sap_hana_preconfigure_req_repos_RedHat_8_ppc64le }}" -sap_hana_preconfigure_req_repos_RedHat_9_x86_64: "{{ __sap_hana_preconfigure_req_repos_RedHat_9_x86_64 }}" -sap_hana_preconfigure_req_repos_RedHat_9_ppc64le: "{{ __sap_hana_preconfigure_req_repos_RedHat_9_ppc64le }}" +sap_hana_preconfigure_req_repos_redhat_7_x86_64: "{{ __sap_hana_preconfigure_req_repos_redhat_7_x86_64 }}" +sap_hana_preconfigure_req_repos_redhat_7_ppc64le: "{{ __sap_hana_preconfigure_req_repos_redhat_7_ppc64le }}" +sap_hana_preconfigure_req_repos_redhat_8_x86_64: "{{ __sap_hana_preconfigure_req_repos_redhat_8_x86_64 }}" +sap_hana_preconfigure_req_repos_redhat_8_ppc64le: "{{ __sap_hana_preconfigure_req_repos_redhat_8_ppc64le }}" +sap_hana_preconfigure_req_repos_redhat_9_x86_64: "{{ __sap_hana_preconfigure_req_repos_redhat_9_x86_64 }}" +sap_hana_preconfigure_req_repos_redhat_9_ppc64le: "{{ __sap_hana_preconfigure_req_repos_redhat_9_ppc64le }}" # Set to "yes" if you want the role to set the RHEL minor release, which is required for SAP HANA. Default is "no". sap_hana_preconfigure_set_minor_release: no # HANA Major and minor version # These variables are used in other SAP HANA related roles, e.g. sap-hana-mediacheck. -sap_hana_version: "2" +sap_hana_version: "2" sap_hana_sps: "0" # List of RHEL packages to be installed for SAP HANA. For RHEL 8 and later, you can choose to install either the default list @@ -115,7 +115,7 @@ sap_hana_preconfigure_ibm_power_repo_url: "{{ __sap_hana_preconfigure_ibm_power_ ## defaults to empty #sap_hana_preconfigure_ppcle_mtu9000_if: "{{ ansible_interfaces| difference(['lo']) }}" # all interfaces sap_hana_preconfigure_ppcle_mtu9000_if: '' -## list where tso flag should be set +## list where tso flag should be set ## defaults to all interfaces sap_hana_preconfigure_ppcle_tso_if: "{{ ansible_interfaces| difference(['lo']) }}" diff --git a/meta/main.yml b/meta/main.yml index 56b9a2a..e19f9d8 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,3 +1,4 @@ +--- galaxy_info: author: Markus Koch, Thomas Bludau, Bernd Finger, Than Ngo description: Performs SAP HANA specific preparation steps on a RHEL system @@ -5,7 +6,7 @@ galaxy_info: license: Apache min_ansible_version: 2.9 platforms: - - name: EL - versions: [ 7, 8 ] + - name: EL + versions: [ 7, 8 ] galaxy_tags: [ 'sap', 'hana', 'rhel' ] dependencies: [] diff --git a/meta/runtime.yml b/meta/runtime.yml new file mode 100644 index 0000000..2ee3c9f --- /dev/null +++ b/meta/runtime.yml @@ -0,0 +1,2 @@ +--- +requires_ansible: '>=2.9.10' diff --git a/tasks/RedHat/assert-configuration.yml b/tasks/RedHat/assert-configuration.yml index 897ad64..214a9d2 100644 --- a/tasks/RedHat/assert-configuration.yml +++ b/tasks/RedHat/assert-configuration.yml @@ -1,17 +1,13 @@ --- -#- name: Enable Debugging -# debug: -# verbosity: "{{ debuglevel }}" -# -- name: List required SAP Notes +- name: Assert - List required SAP Notes debug: var: __sap_hana_preconfigure_sapnotes_versions | difference(['']) - name: Gather service facts service_facts: -- name: Include configuration actions for required sapnotes +- name: Assert - Include configuration actions for required sapnotes include_tasks: "sapnote/assert-{{ sap_note_line_item.number }}.yml" with_items: "{{ __sap_hana_preconfigure_sapnotes_versions | difference(['']) }}" loop_control: diff --git a/tasks/RedHat/assert-installation.yml b/tasks/RedHat/assert-installation.yml index 9780279..e7e0765 100644 --- a/tasks/RedHat/assert-installation.yml +++ b/tasks/RedHat/assert-installation.yml @@ -19,7 +19,7 @@ # repos required for SAP HANA on RHEL 7 and RHEL 8: - name: Fill the variable for the generic list of required repos set_fact: - __sap_hana_preconfigure_required_repos: "{{ lookup('vars','__sap_hana_preconfigure_req_repos_RedHat_' + + __sap_hana_preconfigure_required_repos: "{{ lookup('vars','__sap_hana_preconfigure_req_repos_redhat_' + ansible_distribution_version|string|replace (\".\", \"_\") + '_' + ansible_architecture|string) }}" - name: Get info about enabled repos @@ -48,7 +48,7 @@ debug: var: __sap_hana_preconfigure_register_subscription_manager_release_assert -- name: Assert that the RHEL version is locked correctly +- name: Assert that the RHEL release is locked correctly assert: that: "__sap_hana_preconfigure_register_subscription_manager_release_assert.stdout == '{{ ansible_distribution_version }}'" fail_msg: "FAIL: The RHEL release lock status is '{{ __sap_hana_preconfigure_register_subscription_manager_release_assert.stdout }}' @@ -102,7 +102,7 @@ - name: Minimum required package version check block: - - name: Check if minimum required package versions are installed + - name: Assert - Create a list of minimum required package versions to be installed # How does it work? # 1 - Print the required package name and version with a prefix "1" followed by a space. # 2 - In the same output sequence, list all installed versions of this package with a prefix "2" followed by a space. @@ -119,7 +119,7 @@ # to be updated. # 8 - case 2b: If the first column of the last line of the output is "2", it means that at least of the installed # versions the package is equal to or greater than the required package version. - shell: | + shell: | (echo "1 {{ pkg[0] }}-{{ pkg[1] }}";rpm -q --qf "%{NAME}-%{VERSION}-%{RELEASE}\n" {{ pkg[0] }} | awk '{printf ("2 %s\n", $0)}') | awk '{gsub ("\\.el", ".0.0"); print}' | @@ -138,24 +138,24 @@ } } }' - with_list: "{{ __sap_hana_preconfigure_min_pkgs }}" - loop_control: - loop_var: pkg - check_mode: no - register: __sap_hana_preconfigure_register_minpkglist_assert - changed_when: no - - - name: Assert that minimum required package versions are installed + with_list: "{{ __sap_hana_preconfigure_min_pkgs }}" + loop_control: + loop_var: pkg + check_mode: no + register: __sap_hana_preconfigure_register_minpkglist_assert + changed_when: no + + - name: Assert that minimum required package versions are installed # If the output includes the string "is already installed" (case 2b), we have a PASS. Otherwise, it's a FAIL. - assert: - that: "'is already installed' in line_item.stdout" - fail_msg: "FAIL: {{ line_item.stdout }}" - success_msg: "PASS: {{ line_item.stdout }}" - with_items: "{{ __sap_hana_preconfigure_register_minpkglist_assert.results }}" - loop_control: - loop_var: line_item - label: "" - ignore_errors: yes + assert: + that: "'is already installed' in line_item.stdout" + fail_msg: "FAIL: {{ line_item.stdout }}" + success_msg: "PASS: {{ line_item.stdout }}" + with_items: "{{ __sap_hana_preconfigure_register_minpkglist_assert.results }}" + loop_control: + loop_var: line_item + label: "" + ignore_errors: yes when: - sap_hana_preconfigure_min_package_check|bool @@ -189,14 +189,14 @@ msg: "INFO: Not checking for possible package updates (variable sap_hana_preconfigure_update)." when: not sap_hana_preconfigure_update -- name: "Set needs-restarting command in case of RHEL 7" +- name: "Assert - Set needs-restarting command in case of RHEL 7" set_fact: __sap_hana_preconfigure_fact_needs_restarting_command_assert: "needs-restarting -r" when: - ansible_os_family == 'RedHat' - ansible_distribution_major_version == '7' -- name: "Set needs-restarting command in case of RHEL 8 or RHEL 9, except RHEL 8.0" +- name: "Assert - Set needs-restarting command in case of RHEL 8 or RHEL 9, except RHEL 8.0" set_fact: __sap_hana_preconfigure_fact_needs_restarting_command_assert: "yum needs-restarting -r" when: @@ -206,7 +206,7 @@ ) - ansible_distribution_version != '8.0' -- name: "Set customized needs-restarting command in case of RHEL 8.0" +- name: "Assert - Set customized needs-restarting command in case of RHEL 8.0" 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" @@ -214,12 +214,12 @@ - ansible_os_family == 'RedHat' - ansible_distribution_version == '8.0' -- name: Display the command for checking a reboot requirement +- name: Assert - Display the command for checking a reboot requirement debug: var: __sap_hana_preconfigure_fact_needs_restarting_command_assert # Reason for noqa: The command to be executed might contain pipes -- name: Check if system needs to be restarted # noqa command-instead-of-shell +- name: Assert - Determine if system needs to be restarted # noqa command-instead-of-shell shell: "{{ __sap_hana_preconfigure_fact_needs_restarting_command_assert }}" register: __sap_hana_preconfigure_register_needs_restarting_assert changed_when: false diff --git a/tasks/RedHat/configuration.yml b/tasks/RedHat/configuration.yml index 5d45695..f739f31 100644 --- a/tasks/RedHat/configuration.yml +++ b/tasks/RedHat/configuration.yml @@ -1,20 +1,10 @@ --- -#- name: Enable Debugging -# debug: -# verbosity: "{{ debuglevel }}" -# -- name: List required SAP Notes +- name: Configure - List required SAP Notes debug: var: __sap_hana_preconfigure_sapnotes_versions | difference(['']) -# We want to disable firewalld, so we need to check if firewalld is installed -# now in main.yml -#- name: Gather facts about installed packages -# package_facts: -# manager: auto - -- name: Include configuration actions for required sapnotes +- name: Configure - Include configuration actions for required sapnotes include_tasks: "sapnote/{{ sap_note_line_item.number }}.yml" with_items: "{{ __sap_hana_preconfigure_sapnotes_versions | difference(['']) }}" loop_control: diff --git a/tasks/RedHat/generic/assert-2055470-loop-block.yml b/tasks/RedHat/generic/assert-2055470-loop-block.yml index 95fd8e7..51342c2 100644 --- a/tasks/RedHat/generic/assert-2055470-loop-block.yml +++ b/tasks/RedHat/generic/assert-2055470-loop-block.yml @@ -2,13 +2,13 @@ # loop block for sapnote/assert-2055470.yml -- name: Get {{ line_item.name }} from /etc/sysctl.d/ibm_largesend.conf +- name: 2055470 - Get {{ line_item.name }} from /etc/sysctl.d/ibm_largesend.conf command: awk 'BEGIN{FS="="}/{{ line_item.name }}/{print $NF}' /etc/sysctl.d/ibm_largesend.conf register: __sap_hana_preconfigure_register_sysctl_ibm_largesend_conf_parameter_assert changed_when: no ignore_errors: yes -- name: Assert that {{ line_item.name }} is set correctly in /etc/sysctl.d/ibm_largesend.conf +- name: 2055470 - Assert that {{ line_item.name }} is set correctly in /etc/sysctl.d/ibm_largesend.conf assert: that: "__sap_hana_preconfigure_register_sysctl_ibm_largesend_conf_parameter_assert.stdout == '{{ line_item.value }}'" fail_msg: "FAIL: The value of '{{ line_item.name }}' in /etc/sysctl.d/ibm_largesend.conf is @@ -17,13 +17,13 @@ '{{ __sap_hana_preconfigure_register_sysctl_ibm_largesend_conf_parameter_assert.stdout }}'." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" -- name: Get {{ line_item.name }} from sysctl +- name: 2055470 - Get {{ line_item.name }} from sysctl shell: sysctl -n {{ line_item.name }} | awk '{gsub ("\t", " "); print}' register: __sap_hana_preconfigure_register_sysctl_ibm_parameter_assert changed_when: no ignore_errors: yes -- name: Assert that {{ line_item.name }} is set correctly as per sysctl +- name: 2055470 - Assert that {{ line_item.name }} is set correctly as per sysctl assert: that: "__sap_hana_preconfigure_register_sysctl_ibm_parameter_assert.stdout == '{{ line_item.value }}'" fail_msg: "FAIL: The current value of '{{ line_item.name }}' as per sysctl is diff --git a/tasks/RedHat/generic/assert-2382421-loop-block.yml b/tasks/RedHat/generic/assert-2382421-loop-block.yml index d52f7fc..59e3f5e 100644 --- a/tasks/RedHat/generic/assert-2382421-loop-block.yml +++ b/tasks/RedHat/generic/assert-2382421-loop-block.yml @@ -2,14 +2,14 @@ # loop block for sapnote/assert-2382421.yml -- name: Get {{ line_item.name }} from {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} +- name: 2382421 - Get {{ line_item.name }} from {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} command: awk 'BEGIN{FS="="}/{{ line_item.name }}/{print $NF}' {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} register: __sap_hana_preconfigure_register_sysctl_saphana_conf_network_parameter_assert changed_when: no ignore_errors: yes when: __sap_hana_preconfigure_register_stat_sysctl_saphana_conf_assert.stat.exists -- name: Assert that {{ line_item.name }} is set correctly in {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} +- name: 2382421 - Assert that {{ line_item.name }} is set correctly in {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} assert: that: "__sap_hana_preconfigure_register_sysctl_saphana_conf_network_parameter_assert.stdout == '{{ line_item.value }}'" fail_msg: "FAIL: The value of '{{ line_item.name }}' in {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} is @@ -19,13 +19,13 @@ ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" when: __sap_hana_preconfigure_register_stat_sysctl_saphana_conf_assert.stat.exists -- name: Get {{ line_item.name }} from sysctl +- name: 2382421 - Get {{ line_item.name }} from sysctl shell: sysctl -n {{ line_item.name }} | awk '{gsub ("\t", " "); print}' register: __sap_hana_preconfigure_register_sysctl_network_parameter_assert changed_when: no ignore_errors: yes -- name: Assert that {{ line_item.name }} is set correctly as per sysctl +- name: 2382421 - Assert that {{ line_item.name }} is set correctly as per sysctl assert: that: "__sap_hana_preconfigure_register_sysctl_network_parameter_assert.stdout == '{{ line_item.value }}'" fail_msg: "FAIL: The current value of '{{ line_item.name }}' as per sysctl is diff --git a/tasks/RedHat/generic/assert-3024346-loop-block.yml b/tasks/RedHat/generic/assert-3024346-loop-block.yml index 0ba5dfe..2ef2931 100644 --- a/tasks/RedHat/generic/assert-3024346-loop-block.yml +++ b/tasks/RedHat/generic/assert-3024346-loop-block.yml @@ -2,14 +2,14 @@ # loop block for sapnote/assert-3024346.yml -- name: Get {{ line_item.name }} from {{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }} +- name: 3024346 - Get {{ line_item.name }} from {{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }} command: awk 'BEGIN{FS="="}/{{ line_item.name }}/{print $NF}' {{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }} register: __sap_hana_preconfigure_register_sysctl_netapp_hana_conf_network_parameter_assert changed_when: no ignore_errors: yes when: __sap_hana_preconfigure_register_etc_sysctl_netapp_hana_conf_assert.stat.exists -- name: Assert that {{ line_item.name }} is set correctly in {{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }} +- name: 3024346 - Assert that {{ line_item.name }} is set correctly in {{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }} assert: that: "__sap_hana_preconfigure_register_sysctl_netapp_hana_conf_network_parameter_assert.stdout == '{{ line_item.value }}'" fail_msg: "FAIL: The value of '{{ line_item.name }}' in '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' is @@ -19,13 +19,13 @@ ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" when: __sap_hana_preconfigure_register_etc_sysctl_netapp_hana_conf_assert.stat.exists -- name: Get {{ line_item.name }} from sysctl +- name: 3024346 - Get {{ line_item.name }} from sysctl shell: sysctl -n {{ line_item.name }} | awk '{gsub ("\t", " "); print}' register: __sap_hana_preconfigure_register_sysctl_netapp_hana_network_parameter_assert changed_when: no ignore_errors: yes -- name: Assert that {{ line_item.name }} is set correctly as per sysctl +- name: 3024346 - Assert that {{ line_item.name }} is set correctly as per sysctl assert: that: "__sap_hana_preconfigure_register_sysctl_netapp_hana_network_parameter_assert.stdout == '{{ line_item.value }}'" fail_msg: "FAIL: The current value of '{{ line_item.name }}' as per sysctl is diff --git a/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml b/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml index 6149a9a..a62ac0f 100644 --- a/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml +++ b/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml @@ -2,7 +2,7 @@ # can be configured by tuned profile sap-hana, entry "force_latency=70" - block: - - name: Get contents of GRUB_CMDLINE_LINUX in /etc/default/grub + - name: C-States - Get contents of GRUB_CMDLINE_LINUX in /etc/default/grub command: grep GRUB_CMDLINE_LINUX /etc/default/grub register: __sap_hana_preconfigure_register_default_grub_cmdline_cstate_assert changed_when: no @@ -21,7 +21,7 @@ success_msg: "PASS: 'intel_idle.max_cstate=1' is in GRUB_CMDLINE_LINUX in /etc/default/grub." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - - name: Get contents of /proc/cmdline + - name: C-States - Get contents of /proc/cmdline command: cat /proc/cmdline register: __sap_hana_preconfigure_register_proc_cmdline_cstate_assert changed_when: no diff --git a/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml b/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml index 696e67d..72fcbc8 100644 --- a/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml +++ b/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml @@ -29,7 +29,7 @@ success_msg: "PASS: File /etc/rc.d/rc.local exist." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - - name: Assert that file /etc/rc.d/rc.local exists (x86_64 platform only) + - name: Assert that file /etc/rc.d/rc.local is a regular file (x86_64 platform only) assert: that: __sap_hana_preconfigure_register_stat_rc_local_assert.stat.isreg fail_msg: "FAIL: File /etc/rc.d/rc.local is not a regular file!" diff --git a/tasks/RedHat/generic/assert-ksm.yml b/tasks/RedHat/generic/assert-ksm.yml index 0c30df5..642b44a 100644 --- a/tasks/RedHat/generic/assert-ksm.yml +++ b/tasks/RedHat/generic/assert-ksm.yml @@ -1,6 +1,6 @@ --- -- name: Get info about file /etc/init.d/boot.local +- name: Assert - Get info about file /etc/init.d/boot.local stat: path: /etc/init.d/boot.local register: __sap_hana_preconfigure_register_stat_boot_local_ksm_assert @@ -44,7 +44,7 @@ ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" when: __sap_hana_preconfigure_register_stat_boot_local_ksm_assert.stat.exists -- name: Get status of KSM +- name: Assert - Get status of KSM command: cat /sys/kernel/mm/ksm/run register: __sap_hana_preconfigure_register_ksm_active_assert ignore_errors: true diff --git a/tasks/RedHat/generic/assert-thp.yml b/tasks/RedHat/generic/assert-thp.yml index 1a1fdea..1542494 100644 --- a/tasks/RedHat/generic/assert-thp.yml +++ b/tasks/RedHat/generic/assert-thp.yml @@ -2,7 +2,7 @@ # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" - block: - - name: Get contents of GRUB_CMDLINE_LINUX in /etc/default/grub + - name: THP - Get contents of GRUB_CMDLINE_LINUX in /etc/default/grub command: grep GRUB_CMDLINE_LINUX /etc/default/grub register: __sap_hana_preconfigure_register_default_grub_cmdline_thp_assert changed_when: no @@ -14,7 +14,7 @@ success_msg: "PASS: 'transparent_hugepage=never' is in GRUB_CMDLINE_LINUX in /etc/default/grub." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - - name: Get contents of /proc/cmdline + - name: THP - Get contents of /proc/cmdline command: cat /proc/cmdline register: __sap_hana_preconfigure_register_proc_cmdline_thp_assert changed_when: no diff --git a/tasks/RedHat/generic/assert-tsx.yml b/tasks/RedHat/generic/assert-tsx.yml index 0d39705..6d4ce0f 100644 --- a/tasks/RedHat/generic/assert-tsx.yml +++ b/tasks/RedHat/generic/assert-tsx.yml @@ -9,17 +9,17 @@ - name: Report that the rtm CPU flag exists debug: - msg: "INFO: The CPU flags contain ' rtm'." + msg: "INFO: The CPU flags contain 'rtm'." when: __sap_hana_preconfigure_register_lscpu_flags.stdout is regex("^Flags:.*\s*rtm\s*.*") - name: Report that the rtm CPU flag does not exist debug: - msg: "INFO: The CPU flags do not contain ' rtm'." + msg: "INFO: The CPU flags do not contain 'rtm'." when: __sap_hana_preconfigure_register_lscpu_flags.stdout is not regex("^Flags:.*\s*rtm\s*.*") # Note: Assertions are only necessary if rtm is not in the CPU flags. # If rtm is present, we just print an INFO message. - - name: Get contents of GRUB_CMDLINE_LINUX in /etc/default/grub + - name: TSX - Get contents of GRUB_CMDLINE_LINUX in /etc/default/grub command: grep GRUB_CMDLINE_LINUX /etc/default/grub register: __sap_hana_preconfigure_register_default_grub_cmdline_tsx_assert changed_when: no @@ -46,7 +46,7 @@ - "'tsx=on' not in __sap_hana_preconfigure_register_default_grub_cmdline_tsx_assert.stdout" - __sap_hana_preconfigure_register_lscpu_flags.stdout is regex("^Flags:.*\s*rtm\s*.*") - - name: Get contents of /proc/cmdline + - name: TSX - Get contents of /proc/cmdline command: cat /proc/cmdline register: __sap_hana_preconfigure_register_proc_cmdline_tsx_assert changed_when: no diff --git a/tasks/RedHat/generic/assert-tuned.yml b/tasks/RedHat/generic/assert-tuned.yml index c835e47..0130824 100644 --- a/tasks/RedHat/generic/assert-tuned.yml +++ b/tasks/RedHat/generic/assert-tuned.yml @@ -22,7 +22,7 @@ fail_msg: "FAIL: Service 'tuned' is not enabled!" success_msg: "PASS: Service 'tuned' is enabled." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - when: + when: - "'tuned.service' in ansible_facts.services" - sap_hana_preconfigure_use_tuned @@ -32,14 +32,14 @@ fail_msg: "FAIL: Service 'tuned' is not active!" success_msg: "PASS: Service 'tuned' is active." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - when: + when: - "'tuned.service' in ansible_facts.services" - sap_hana_preconfigure_use_tuned - name: "Report if tuned.service does not exist - use_tuned: no" debug: msg: "PASS: Service 'tuned' could not be found." - when: + when: - "'tuned.service' not in ansible_facts.services" - not sap_hana_preconfigure_use_tuned @@ -49,7 +49,7 @@ fail_msg: "FAIL: Service 'tuned' is not disabled!" success_msg: "PASS: Service 'tuned' is disabled." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - when: + when: - "'tuned.service' in ansible_facts.services" - not sap_hana_preconfigure_use_tuned @@ -59,7 +59,7 @@ fail_msg: "FAIL: Service 'tuned' is not inactive!" success_msg: "PASS: Service 'tuned' is inactive." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - when: + when: - "'tuned.service' in ansible_facts.services" - not sap_hana_preconfigure_use_tuned diff --git a/tasks/RedHat/generic/configure-epb.yml b/tasks/RedHat/generic/configure-epb.yml index a18b545..37541bd 100644 --- a/tasks/RedHat/generic/configure-epb.yml +++ b/tasks/RedHat/generic/configure-epb.yml @@ -48,7 +48,7 @@ var: __sap_hana_preconfigure_register_cpupower_info.stdout_lines, __sap_hana_preconfigure_register_cpupower_info.stderr_lines when: - - __sap_hana_preconfigure_register_cpupower_info_epb_supported.stdout != 'does not support' + - __sap_hana_preconfigure_register_cpupower_info_epb_supported.stdout != 'does not support' when: - ansible_architecture == 'x86_64' diff --git a/tasks/RedHat/generic/disable-ksm.yml b/tasks/RedHat/generic/disable-ksm.yml index 6a1db90..a1dee2f 100644 --- a/tasks/RedHat/generic/disable-ksm.yml +++ b/tasks/RedHat/generic/disable-ksm.yml @@ -6,7 +6,7 @@ state: touch mode: 0755 -- name: Get info about file /etc/init.d/boot.local +- name: Configure - Get info about file /etc/init.d/boot.local stat: path: /etc/init.d/boot.local register: __sap_hana_preconfigure_register_stat_boot_local_ksm @@ -22,12 +22,7 @@ register: __sap_hana_preconfigure_register_disable_ksm changed_when: true -# The following should not really be necessary: -#- name: Display the result of disabling KSM on the running system -# debug: -# var: __sap_hana_preconfigure_register_disable_ksm.stdout_lines, __sap_hana_preconfigure_register_disable_ksm.stderr_lines - -- name: Get status of KSM +- name: Configure - Get status of KSM command: cat /sys/kernel/mm/ksm/run register: __sap_hana_preconfigure_register_ksm_status ignore_errors: true diff --git a/tasks/RedHat/generic/disable-thp.yml b/tasks/RedHat/generic/disable-thp.yml index 609bc4b..9d12a6e 100644 --- a/tasks/RedHat/generic/disable-thp.yml +++ b/tasks/RedHat/generic/disable-thp.yml @@ -10,7 +10,7 @@ regexp: '^(GRUB_CMDLINE_LINUX=(?!.* {{ line_item }}).*). *$' line: "\\1 {{ line_item }}\"" with_items: - - "transparent_hugepage=never" + - "transparent_hugepage=never" notify: __sap_hana_preconfigure_regenerate_grub2_conf_handler when: not sap_hana_preconfigure_use_tuned or sap_hana_preconfigure_modify_grub_cmdline_linux diff --git a/tasks/RedHat/installation.yml b/tasks/RedHat/installation.yml index e18e399..cb4bc88 100644 --- a/tasks/RedHat/installation.yml +++ b/tasks/RedHat/installation.yml @@ -1,6 +1,6 @@ --- -- name: Assert that the RHEL release is supported for SAP HANA +- name: Ensure that the system is running a RHEL release which is supported for SAP HANA assert: that: ansible_distribution_version in "{{ sap_hana_preconfigure_supported_rhel_minor_releases }}" fail_msg: "The RHEL release {{ ansible_distribution_version }} is not supported for SAP HANA!" @@ -9,22 +9,22 @@ - block: # repos required for SAP HANA on RHEL 7 and RHEL 8: - - name: Fill the variable for the generic list of required repos - set_fact: - __sap_hana_preconfigure_fact_required_repos: "{{ lookup('vars','__sap_hana_preconfigure_req_repos_RedHat_' + - ansible_distribution_version|string|replace (\".\", \"_\") + '_' + ansible_architecture) }}" + - name: Fill the variable for the generic list of required repos + set_fact: + __sap_hana_preconfigure_fact_required_repos: "{{ lookup('vars','__sap_hana_preconfigure_req_repos_redhat_' + + ansible_distribution_version|string|replace (\".\", \"_\") + '_' + ansible_architecture) }}" - - name: Construct valid argument list to the subscription-manager repos command - set_fact: - __sap_hana_preconfigure_fact_required_repos_args: "{{ ['--enable='] | product(__sap_hana_preconfigure_fact_required_repos) | map('join') | list }}" + - name: Construct valid argument list to the subscription-manager repos command + set_fact: + __sap_hana_preconfigure_fact_required_repos_args: "{{ ['--enable='] | product(__sap_hana_preconfigure_fact_required_repos) | map('join') | list }}" - - name: Enable required repositories - command: "subscription-manager repos {{ __sap_hana_preconfigure_fact_required_repos_args | map('quote') | join(' ') }}" - register: __sap_hana_preconfigure_register_subscription_enable_repos + - name: Enable required repositories + command: "subscription-manager repos {{ __sap_hana_preconfigure_fact_required_repos_args | map('quote') | join(' ') }}" + register: __sap_hana_preconfigure_register_subscription_enable_repos - - name: Display the output of the subscription-manager repos --enable command - debug: - var: __sap_hana_preconfigure_register_subscription_enable_repos + - name: Display the output of the subscription-manager repos --enable command + debug: + var: __sap_hana_preconfigure_register_subscription_enable_repos when: sap_hana_preconfigure_enable_sap_hana_repos @@ -98,14 +98,14 @@ # changed_when: false # when: ansible_architecture == "ppc64le" # -# - name: Get status of installed packages +# - name: ppc64le - Get status of installed packages # debug: # var: __sap_hana_preconfigure_register_required_ppc64le_packages.results # when: ansible_architecture == "ppc64le" -- name: Ensure minimum required package versions are installed +- name: Ensure that the minimum required package versions are installed block: - - name: Check if minimum required package versions are installed + - name: Create a list of minimum required package versions to be installed # How does it work? # 1 - Print the required package name and version with a prefix "1" followed by a space. # 2 - In the same output sequence, list all installed versions of this package with a prefix "2" followed by a space. @@ -122,7 +122,7 @@ # to be updated. # 8 - case 2b: If the first column of the last line of the output is "2", it means that at least of the installed # versions the package is equal to or greater than the required package version. - shell: | + shell: | (echo "1 {{ pkg[0] }}-{{ pkg[1] }}";rpm -q --qf "%{NAME}-%{VERSION}-%{RELEASE}\n" {{ pkg[0] }} | awk '{printf ("2 %s\n", $0)}') | awk '{gsub ("\\.el", ".0.0"); print}' | @@ -138,31 +138,31 @@ } } }' - with_list: "{{ __sap_hana_preconfigure_min_pkgs }}" - loop_control: - loop_var: pkg - check_mode: no - register: __sap_hana_preconfigure_register_minpkglist - changed_when: no - - - name: Display the content of the minimum package list variable - debug: - var: __sap_hana_preconfigure_register_minpkglist - - - name: Install minimum packages if required - yum: - name: "{{ line_item.stdout }}" - state: present - with_items: "{{ __sap_hana_preconfigure_register_minpkglist.results }}" - loop_control: - loop_var: line_item + with_list: "{{ __sap_hana_preconfigure_min_pkgs }}" + loop_control: + loop_var: pkg + check_mode: no + register: __sap_hana_preconfigure_register_minpkglist + changed_when: no + + - name: Display the content of the minimum package list variable + debug: + var: __sap_hana_preconfigure_register_minpkglist + + - name: Install minimum packages if required + yum: + name: "{{ line_item.stdout }}" + state: present + with_items: "{{ __sap_hana_preconfigure_register_minpkglist.results }}" + loop_control: + loop_var: line_item when: - sap_hana_preconfigure_min_package_check|bool - __sap_hana_preconfigure_min_pkgs|d([]) # Reason for noqa: Both yum and dnf support "state: latest" -- name: Ensure system is updated to the latest patchlevel # noqa package-latest +- name: Ensure that the system is updated to the latest patchlevel # noqa package-latest package: state: latest name: "*" @@ -197,7 +197,7 @@ var: __sap_hana_preconfigure_fact_needs_restarting_command # Reason for noqa: The command to be executed might contain pipes -- name: Check if system needs to be restarted # noqa command-instead-of-shell +- name: Determine if system needs to be restarted # noqa command-instead-of-shell shell: "{{ __sap_hana_preconfigure_fact_needs_restarting_command }}" register: __sap_hana_preconfigure_register_needs_restarting ignore_errors: true diff --git a/tasks/sapnote/2009879.yml b/tasks/sapnote/2009879.yml index d9924a8..b88e459 100644 --- a/tasks/sapnote/2009879.yml +++ b/tasks/sapnote/2009879.yml @@ -2,7 +2,7 @@ # OS RELEASE: RHEL 6.x, 7.x # Check EUS Channels # https://launchpad.support.sap.com/#/notes/2009879 -# +# # This SAP Note Contains the general installation guides for all RHEL systems in PDF format # We include the release specific stuff here # @@ -12,9 +12,9 @@ #- name: Check for EUS or E4S repository # 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++} +# 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++} # END {print a}' # register: sap_hana_preconfigure_register_eus # changed_when: false @@ -22,8 +22,8 @@ #- name: Output warning # debug: # msg: "We could not recognize the correct RHEL repositories for SAP HANA. Please make sure you the proper EUS or E4S repositories available" -# when: -# - sap_hana_preconfigure_register_eus.stdout != "2" +# when: +# - sap_hana_preconfigure_register_eus.stdout != "2" # ignore_errors: true ### Package installation is done in installation.yml diff --git a/tasks/sapnote/2009879_7.yml b/tasks/sapnote/2009879_7.yml index 38844c8..24918e3 100644 --- a/tasks/sapnote/2009879_7.yml +++ b/tasks/sapnote/2009879_7.yml @@ -2,7 +2,7 @@ # OS RELEASE: RHEL 7.x # Check EUS Channels # https://launchpad.support.sap.com/#/notes/2009879 -# +# # This SAP Note Contains the general installation guides for all RHEL 7.x systems in PDF format # # Some of these tasks are documented already in SAP NOTE 2292690 @@ -11,14 +11,14 @@ ### 3.1 - Basic OS installation is a prerequisite ### 3.2 - Additional Package installation is done in the installation.yml file -### 3.3 - Hostname - is an SAP generic setting, already done with SAP Note 2002167 (sap-preconfigure) +### 3.3 - Hostname - is an SAP generic setting, already done with SAP Note 2002167 (sap-preconfigure) ### 3.4 - NTP/Chrony - is a generic SAP requirement, needs to be done by linux-system-roles.timesync ### 3.5 - Configure Storage - out of scooe, have a look at linux-system-roles.storage ### 3.6 - Activate SAP HANA specific tuned profile -> SAP Note 2292690 ### 3.7 - Disable SE Linux -> SAP Note 2292690, SAP NOTE 2002167 -### 3.8 - Disable Numa Balancing -> SAP Note 2292690 +### 3.8 - Disable Numa Balancing -> SAP Note 2292690 -### 3.9 - Create the compatibility links for HANA +### 3.9 - Create the compatibility links for HANA - block: - name: 3.9 create compatibility links for RHEL 7.2 file: src=/usr/lib64/{{ line_item.src }} dest=/usr/lib64/{{ line_item.dest }} state=link @@ -26,7 +26,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_distribution_version == '7.2' ) loop_control: loop_var: line_item @@ -36,23 +36,23 @@ - { 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_distribution_version != '7.2' ) loop_control: loop_var: line_item when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2009879_3_9|d(false) -### 3.10 - THP -> SAP Note 2292690 +### 3.10 - THP -> SAP Note 2292690 ### 3.11 - CPU Governor for performance -> TunedProfile -> SAP Note 2292690 ### 3.12 - Processor C-States für x86_64 -> SAP Note 2292690 ### Set by HANA installer -#- name: increase file handles to 32800 for sapsys group -# pam_limits: +#- name: Configure - Increase file handles to 32800 for sapsys group +# pam_limits: # dest: /etc/security/limits.d/99-sapsys.conf -# domain: "@sapsys" -# limit_item: nofile -# limit_type: "{{ line_item }}" +# domain: "@sapsys" +# limit_item: nofile +# limit_type: "{{ line_item }}" # value: 32800 # with_items: # - soft diff --git a/tasks/sapnote/2055470.yml b/tasks/sapnote/2055470.yml index 7c385ca..141304a 100644 --- a/tasks/sapnote/2055470.yml +++ b/tasks/sapnote/2055470.yml @@ -5,9 +5,9 @@ # https://launchpad.support.sap.com/#/notes/2055470 # The SAP Note points to http://www-03.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/WP102502 -## On the above page you will find more PDF documents, the following is used in this config file: -## Configuring your Network for SAP HANA (Ethernet connectivity): -## http://www-03.ibm.com/support/techdocs/atsmastr.nsf/5cb5ed706d254a8186256c71006d2e0a/c32b40501f4f76c886257de0004fa1d4/$FILE/ +# On the above page you will find more PDF documents, the following is used in this config file: +# Configuring your Network for SAP HANA (Ethernet connectivity): +# http://www-03.ibm.com/support/techdocs/atsmastr.nsf/5cb5ed706d254a8186256c71006d2e0a/c32b40501f4f76c886257de0004fa1d4/$FILE/ # Network_Configuration_for_HANA_Workloads_on_IBM_Power_Servers_V4.pdf - name: Perform configuration changes for ppc64le @@ -39,7 +39,7 @@ loop_control: loop_var: line_item -## This only works if interfacename=device name, otherwise it fails +# This only works if interfacename=device name, otherwise it fails - name: Add largesend options to interfaces lineinfile: path: /etc/sysconfig/network-scripts/ifcfg-{{ line_item }} diff --git a/tasks/sapnote/2292690.yml b/tasks/sapnote/2292690.yml index e16f9a4..78ece9e 100644 --- a/tasks/sapnote/2292690.yml +++ b/tasks/sapnote/2292690.yml @@ -1,6 +1,4 @@ --- -# tasks file for sap-hana-preconfigure configuration - - name: Configure - Display SAP note number 2292690 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2292690$') | first).number }} diff --git a/tasks/sapnote/2382421.yml b/tasks/sapnote/2382421.yml index 1d0caa4..3c05152 100644 --- a/tasks/sapnote/2382421.yml +++ b/tasks/sapnote/2382421.yml @@ -9,24 +9,24 @@ - name: Set kernel tunables as per SAP note 2382421 block: - - name: Modify entries in file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' - lineinfile: - path: "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" - create: yes - mode: 0644 - regexp: ^{{ line_item.name }}.* - line: "{{ line_item.name }}={{ line_item.value }}" - state: present - with_items: "{{ sap_hana_preconfigure_kernel_parameters }}" - loop_control: - loop_var: line_item + - name: Modify entries in file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' + lineinfile: + path: "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" + create: yes + mode: 0644 + regexp: ^{{ line_item.name }}.* + line: "{{ line_item.name }}={{ line_item.value }}" + state: present + with_items: "{{ sap_hana_preconfigure_kernel_parameters }}" + loop_control: + loop_var: line_item - - name: Reload kernel parameters from file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' - command: sysctl -p "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" - register: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output + - name: Reload kernel parameters from file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' + command: sysctl -p "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" + register: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output - - name: Print kernel parameters for network tuning - debug: - var: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output.stdout_lines + - name: Print kernel parameters for network tuning + debug: + var: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output.stdout_lines when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2382421|d(false) diff --git a/tasks/sapnote/2777782.yml b/tasks/sapnote/2777782.yml index bb08ac9..96b422d 100644 --- a/tasks/sapnote/2777782.yml +++ b/tasks/sapnote/2777782.yml @@ -1,12 +1,11 @@ --- -# tasks file for sap-hana-preconfigure configuration - - name: Configure - Display SAP note number 2777782 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2777782$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2777782$') | first).version }}): SAP HANA settings for RHEL 8" -# Step 1: SELinux is already configured in role sap-preconfigure. +- import_tasks: 2777782/01-configure-selinux.yml + when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2777782_01|d(false) - import_tasks: 2777782/02-configure-tuned.yml when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2777782_02|d(false) diff --git a/tasks/sapnote/2777782/01-assert-selinux.yml b/tasks/sapnote/2777782/01-assert-selinux.yml new file mode 100644 index 0000000..ea46d2c --- /dev/null +++ b/tasks/sapnote/2777782/01-assert-selinux.yml @@ -0,0 +1,9 @@ +--- + +- name: Assert 2777782-1 + debug: + msg: "SAP note 2777782 Step 1: Configure SELinux" + +- name: Notify about where SELinux is asserted + debug: + msg: "SELinux is already asserted by role sap-preconfigure." diff --git a/tasks/sapnote/2777782/01-configure-selinux.yml b/tasks/sapnote/2777782/01-configure-selinux.yml new file mode 100644 index 0000000..cb03611 --- /dev/null +++ b/tasks/sapnote/2777782/01-configure-selinux.yml @@ -0,0 +1,9 @@ +--- + +- name: Configure 2777782-1 + debug: + msg: "SAP note 2777782 Step 1: Configure SELinux" + +- name: Notify about where SELinux is configured + debug: + msg: "SELinux is already configured by role sap-preconfigure." diff --git a/tasks/sapnote/2777782/10-assert-pidmax.yml b/tasks/sapnote/2777782/10-assert-pidmax.yml index 56f2d19..3578e86 100644 --- a/tasks/sapnote/2777782/10-assert-pidmax.yml +++ b/tasks/sapnote/2777782/10-assert-pidmax.yml @@ -2,56 +2,8 @@ - name: Assert 2777782-10 debug: - msg: "SAP note 2777782 Step 10: Increase kernel.pid_max" + msg: "SAP note 2777782 Step 10: Increase pidmax" -- name: Get info about file /etc/sysctl.d/sap.conf - stat: - path: /etc/sysctl.d/sap.conf - register: __sap_hana_preconfigure_register_stat_sysctl_sap_conf_assert - -- name: Assert that file /etc/sysctl.d/sap.conf exists - assert: - that: __sap_hana_preconfigure_register_stat_sysctl_sap_conf_assert.stat.exists - fail_msg: "FAIL: File /etc/sysctl.d/sap.conf does not exist!" - success_msg: "PASS: File /etc/sysctl.d/sap.conf exists." - ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - -- name: Assert that file /etc/sysctl.d/sap.conf is a regular file - assert: - that: __sap_hana_preconfigure_register_stat_sysctl_sap_conf_assert.stat.isreg - fail_msg: "FAIL: File /etc/sysctl.d/sap.conf is not a regular file!" - success_msg: "PASS: File /etc/sysctl.d/sap.conf is a regular file." - ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - when: __sap_hana_preconfigure_register_stat_sysctl_sap_conf_assert.stat.exists - -- name: Check if kernel.pid_max is set to 4194304 in /etc/sysctl.d/sap.conf - command: awk 'BEGIN{FS="="}/kernel.pid_max/{split ($2, a, " "); print a[1]}' /etc/sysctl.d/sap.conf - register: __sap_hana_preconfigure_register_sysctl_sap_conf_pid_max_assert - changed_when: no - ignore_errors: yes - when: __sap_hana_preconfigure_register_stat_sysctl_sap_conf_assert.stat.isreg - -- name: Assert that kernel.pid_max is set to 4194304 in /etc/sysctl.d/sap.conf - assert: - that: "__sap_hana_preconfigure_register_sysctl_sap_conf_pid_max_assert.stdout == '4194304'" - fail_msg: "FAIL: The value of 'kernel.pid_max' in /etc/sysctl.d/sap.conf is - '{{ __sap_hana_preconfigure_register_sysctl_sap_conf_pid_max_assert.stdout }}' but the expected value is '4194304'!" - success_msg: "PASS: The value of 'kernel.pid_max' in /etc/sysctl.d/sap.conf is - '{{ __sap_hana_preconfigure_register_sysctl_sap_conf_pid_max_assert.stdout }}'." - ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - when: __sap_hana_preconfigure_register_stat_sysctl_sap_conf_assert.stat.isreg - -- name: Check if kernel.pid_max is set to 4194304 as per sysctl - command: sysctl -n kernel.pid_max - register: __sap_hana_preconfigure_register_sysctl_pid_max_assert - changed_when: no - ignore_errors: yes - -- name: Assert that kernel.pid_max is set to 4194304 as per sysctl - assert: - that: "__sap_hana_preconfigure_register_sysctl_pid_max_assert.stdout == '4194304'" - fail_msg: "FAIL: The current value of 'kernel.pid_max' as per sysctl is - '{{ __sap_hana_preconfigure_register_sysctl_pid_max_assert.stdout }}' but the expected value is '4194304'!" - success_msg: "PASS: The current value of 'kernel.pid_max' as per sysctl is - '{{ __sap_hana_preconfigure_register_sysctl_pid_max_assert.stdout }}'." - ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" +- name: Notify about where pidmax is asserted + debug: + msg: "INFO: Kernel parameter pidmax is already asserted by role sap-preconfigure." diff --git a/tasks/sapnote/2777782/10-increase-pidmax.yml b/tasks/sapnote/2777782/10-increase-pidmax.yml index 0a90449..3c77554 100644 --- a/tasks/sapnote/2777782/10-increase-pidmax.yml +++ b/tasks/sapnote/2777782/10-increase-pidmax.yml @@ -2,22 +2,8 @@ - name: Configure 2777782-10 debug: - msg: "SAP note 2777782 Step 10: Increase kernel.pid_max" + msg: "SAP note 2777782 Step 10: Increase pidmax" -- name: Set kernel parameter kernel.pid_max to 4194304 - lineinfile: - path: /etc/sysctl.d/sap.conf - create: yes - mode: 0644 - regexp: ^kernel.pid_max.* - line: 'kernel.pid_max=4194304' - state: present - -- name: Reload kernel parameters from file '/etc/sysctl.d/sap.conf' - command: sysctl -p /etc/sysctl.d/sap.conf - register: __sap_hana_preconfigure_register_sap_conf_sysctl_p_output - changed_when: true - -- name: Print kernel parameters after setting kernel.pid_max +- name: Notify about where pidmax is set debug: - var: __sap_hana_preconfigure_register_sap_conf_sysctl_p_output.stdout_lines + msg: "Kernel parameter pidmax is already set by role sap-preconfigure." diff --git a/tasks/sapnote/3024346.yml b/tasks/sapnote/3024346.yml index d7cb882..a0f33c7 100644 --- a/tasks/sapnote/3024346.yml +++ b/tasks/sapnote/3024346.yml @@ -9,34 +9,34 @@ - name: Set kernel tunables for NetApp NFS as per SAP note 3024346 block: - - name: Modify entries in file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' - lineinfile: - path: "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" - create: yes - mode: 0644 - regexp: ^{{ line_item.name }}.* - line: "{{ line_item.name }}={{ line_item.value }}" - state: present - with_items: "{{ __sap_hana_preconfigure_kernel_parameters_netapp_nfs }}" - loop_control: - loop_var: line_item + - name: Modify entries in file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' + lineinfile: + path: "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" + create: yes + mode: 0644 + regexp: ^{{ line_item.name }}.* + line: "{{ line_item.name }}={{ line_item.value }}" + state: present + with_items: "{{ __sap_hana_preconfigure_kernel_parameters_netapp_nfs }}" + loop_control: + loop_var: line_item - - name: Reload kernel parameters from file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' - command: sysctl -p "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" - register: __sap_hana_preconfigure_register_netapp_sysctl_p_output + - name: Reload kernel parameters from file '{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}' + command: sysctl -p "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" + register: __sap_hana_preconfigure_register_netapp_sysctl_p_output - - name: Display kernel parameters for NetApp NFS - debug: - var: __sap_hana_preconfigure_register_netapp_sysctl_p_output.stdout_lines + - name: Display kernel parameters for NetApp NFS + debug: + var: __sap_hana_preconfigure_register_netapp_sysctl_p_output.stdout_lines - - name: Set kernel tunable for NFSv3 as per SAP note 3024346 - lineinfile: - path: /etc/modprobe.d/sunrpc.conf - create: yes - mode: 0644 - regexp: '^options sunrpc tcp_max_slot_table_entries' - line: options sunrpc tcp_max_slot_table_entries=128 - when: sap_hana_preconfigure_use_netapp_settings_nfsv3 + - name: Set kernel tunable for NFSv3 as per SAP note 3024346 + lineinfile: + path: /etc/modprobe.d/sunrpc.conf + create: yes + mode: 0644 + regexp: '^options sunrpc tcp_max_slot_table_entries' + line: options sunrpc tcp_max_slot_table_entries=128 + when: sap_hana_preconfigure_use_netapp_settings_nfsv3 when: - sap_hana_preconfigure_use_netapp_settings_nfs|d(false) diff --git a/tasks/sapnote/assert-2009879.yml b/tasks/sapnote/assert-2009879.yml index 74be2d1..44ceb5b 100644 --- a/tasks/sapnote/assert-2009879.yml +++ b/tasks/sapnote/assert-2009879.yml @@ -2,7 +2,7 @@ # OS RELEASE: RHEL 6.x, 7.x # Check EUS Channels # https://launchpad.support.sap.com/#/notes/2009879 -# +# # This SAP Note Contains the general installation guides for all RHEL systems in PDF format # We include the release specific stuff here # diff --git a/tasks/sapnote/assert-2009879_7.yml b/tasks/sapnote/assert-2009879_7.yml index 9bb4da0..c498920 100644 --- a/tasks/sapnote/assert-2009879_7.yml +++ b/tasks/sapnote/assert-2009879_7.yml @@ -2,7 +2,7 @@ # OS RELEASE: RHEL 7.x # Check EUS Channels # https://launchpad.support.sap.com/#/notes/2009879 -# +# # This SAP Note Contains the general installation guides for all RHEL 7.x systems in PDF format # # Some of these tasks are documented already in SAP NOTE 2292690 @@ -11,31 +11,31 @@ ### 3.1 - Basic OS installation is a prerequisite ### 3.2 - Additional Package installation is done in the installation.yml file -### 3.3 - Hostname - is an SAP generic setting, already done with SAP Note 2002167 (sap-preconfigure) +### 3.3 - Hostname - is an SAP generic setting, already done with SAP Note 2002167 (sap-preconfigure) ### 3.4 - NTP/Chrony - is a generic SAP requirement, needs to be done by linux-system-roles.timesync ### 3.5 - Configure Storage - out of scooe, have a look at linux-system-roles.storage ### 3.6 - Activate SAP HANA specific tuned profile -> SAP Note 2292690 ### 3.7 - Disable SE Linux -> SAP Note 2292690, SAP NOTE 2002167 -### 3.8 - Disable Numa Balancing -> SAP Note 2292690 +### 3.8 - Disable Numa Balancing -> SAP Note 2292690 -### 3.9 - Create the compatibility links for HANA +### 3.9 - Create the compatibility links for HANA - name: Check if required links exist block: - name: ... in case of RHEL 7.2 block: - - name: Get info about file /usr/lib64/libssl.so.1.0.1 + - name: RHEL 7.2 - Get info about file /usr/lib64/libssl.so.1.0.1 stat: path: /usr/lib64/libssl.so.1.0.1 register: __sap_hana_preconfigure_register_stat_libssl_rhel_72_assert - - name: Assert that file /usr/lib64/libssl.so.1.0.1 exists + - name: RHEL 7.2 - Assert that file /usr/lib64/libssl.so.1.0.1 exists assert: that: __stat_lpbldap.stat.exists fail_msg: "FAIL: File /usr/lib64/libssl.so.1.0.1 does not exist!" success_msg: "PASS: File /usr/lib64/libssl.so.1.0.1 exist." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - - name: Assert that file /usr/lib64/libssl.so.1.0.1 is a link + - name: RHEL 7.2 - Assert that file /usr/lib64/libssl.so.1.0.1 is a link assert: that: __sap_hana_preconfigure_register_stat_libssl_rhel_72_assert.stat.islnk fail_msg: "FAIL: File /usr/lib64/libssl.so.1.0.1 is not a link!" @@ -43,7 +43,7 @@ ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" when: __sap_hana_preconfigure_register_stat_libssl_rhel_72_assert.stat.exists - - name: Assert that file /usr/lib64/libssl.so.1.0.1 is a link to /usr/lib64/libssl.so.1.0.1e + - name: RHEL 7.2 - Assert that file /usr/lib64/libssl.so.1.0.1 is a link to /usr/lib64/libssl.so.1.0.1e assert: that: "__sap_hana_preconfigure_register_stat_libssl_rhel_72_assert.stat.lnk_target == '/usr/lib64/libssl.so.1.0.1e'" fail_msg: "FAIL: File /usr/lib64/libssl.so.1.0.1 is not a link to /usr/lib64/libssl.so.1.0.1e!" @@ -51,19 +51,19 @@ ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" when: __sap_hana_preconfigure_register_stat_libssl_rhel_72_assert.stat.exists - - name: Get info about file /usr/lib64/libcrypto.so.1.0.1 + - name: RHEL 7.2 - Get info about file /usr/lib64/libcrypto.so.1.0.1 stat: path: /usr/lib64/libcrypto.so.1.0.1 register: __sap_hana_preconfigure_register_stat_libcrypto_rhel_72_assert - - name: Assert that file /usr/lib64/libcrypto.so.1.0.1 exists + - name: RHEL 7.2 - Assert that file /usr/lib64/libcrypto.so.1.0.1 exists assert: that: __sap_hana_preconfigure_register_stat_libcrypto_rhel_72_assert.stat.exists fail_msg: "FAIL: File /usr/lib64/libcrypto.so.1.0.1 does not exist!" success_msg: "PASS: File /usr/lib64/libcrypto.so.1.0.1 exist." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - - name: Assert that file /usr/lib64/libcrypto.so.1.0.1 exists and is a link + - name: RHEL 7.2 - Assert that file /usr/lib64/libcrypto.so.1.0.1 exists and is a link assert: that: __sap_hana_preconfigure_register_stat_libcrypto_rhel_72_assert.stat.islnk fail_msg: "FAIL: File /usr/lib64/libcrypto.so.1.0.1 is not a link!" @@ -71,7 +71,7 @@ ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" when: __sap_hana_preconfigure_register_stat_libcrypto_rhel_72_assert.stat.exists - - name: Assert that file /usr/lib64/libcrypto.so.1.0.1 is a link to /usr/lib64/libcrypto.so.1.0.1e + - name: RHEL 7.2 - Assert that file /usr/lib64/libcrypto.so.1.0.1 is a link to /usr/lib64/libcrypto.so.1.0.1e assert: that: "__sap_hana_preconfigure_register_stat_libcrypto_rhel_72_assert.stat.lnk_target == '/usr/lib64/libcrypto.so.1.0.1e'" fail_msg: "FAIL: File /usr/lib64/libcrypto.so.1.0.1 is not a link to /usr/lib64/libcrypto.so.1.0.1e!" @@ -143,17 +143,17 @@ when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2009879_3_9|d(false) -### 3.10 - THP -> SAP Note 2292690 +### 3.10 - THP -> SAP Note 2292690 ### 3.11 - CPU Governor for performance -> TunedProfile -> SAP Note 2292690 ### 3.12 - Processor C-States für x86_64 -> SAP Note 2292690 ### Set by HANA installer -#- name: increase file handles to 32800 for sapsys group -# pam_limits: +#- name: Assert - increase file handles to 32800 for sapsys group +# pam_limits: # dest: /etc/security/limits.d/99-sapsys.conf -# domain: "@sapsys" -# limit_item: nofile -# limit_type: "{{ line_item }}" +# domain: "@sapsys" +# limit_item: nofile +# limit_type: "{{ line_item }}" # value: 32800 # with_items: # - soft @@ -163,7 +163,7 @@ ### 3.13 - set number of process to unlimited for sapsys group # now in role sap-preconfigure -#- name: 3.13 Set the hard and soft limit for the max number of processes per user (nproc) to unlimited for group sapsys +#- name: Assert - 3.13 Set the hard and soft limit for the max number of processes per user (nproc) to unlimited for group sapsys # block: # - name: Get the hard limit of nproc for group sapsys # command: awk '/sapsys/&&/nproc/&&/hard/{print $NF}' /etc/security/limits.d/99-sap.conf diff --git a/tasks/sapnote/assert-2055470.yml b/tasks/sapnote/assert-2055470.yml index 3adcb0c..a39d4ac 100644 --- a/tasks/sapnote/assert-2055470.yml +++ b/tasks/sapnote/assert-2055470.yml @@ -5,9 +5,9 @@ # https://launchpad.support.sap.com/#/notes/2055470 # The SAP Note points to http://www-03.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/WP102502 -## On the above page you will find more PDF documents, the following is used in this config file: -## Configuring your Network for SAP HANA (Ethernet connectivity): -## http://www-03.ibm.com/support/techdocs/atsmastr.nsf/5cb5ed706d254a8186256c71006d2e0a/c32b40501f4f76c886257de0004fa1d4/$FILE/ +# On the above page you will find more PDF documents, the following is used in this config file: +# Configuring your Network for SAP HANA (Ethernet connectivity): +# http://www-03.ibm.com/support/techdocs/atsmastr.nsf/5cb5ed706d254a8186256c71006d2e0a/c32b40501f4f76c886257de0004fa1d4/$FILE/ # Network_Configuration_for_HANA_Workloads_on_IBM_Power_Servers_V4.pdf - block: @@ -40,7 +40,7 @@ # loop_control: # loop_var: line_item -## This only works if interfacename=device name, otherwise it fails +# This only works if interfacename=device name, otherwise it fails - name: Display an info about checking largesend options debug: msg: "WARN: Checking of largesend options of interface {{ sap_hana_preconfigure_ppcle_tso_if }} not yet implemented. Please check manually!" @@ -56,25 +56,25 @@ # loop_var: line_item - block: - - name: Get info about file /etc/sysctl.d/ibm_largesend.conf - stat: - path: /etc/sysctl.d/ibm_largesend.conf - register: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert + - name: Get info about file /etc/sysctl.d/ibm_largesend.conf + stat: + path: /etc/sysctl.d/ibm_largesend.conf + register: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert - - name: Assert that file /etc/sysctl.d/ibm_largesend.conf exists - assert: - that: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert.stat.exists - fail_msg: "FAIL: File /etc/sysctl.d/ibm_largesend.conf does not exist!" - success_msg: "PASS: File /etc/sysctl.d/ibm_largesend.conf exists." - ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" + - name: Assert that file /etc/sysctl.d/ibm_largesend.conf exists + assert: + that: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert.stat.exists + fail_msg: "FAIL: File /etc/sysctl.d/ibm_largesend.conf does not exist!" + success_msg: "PASS: File /etc/sysctl.d/ibm_largesend.conf exists." + ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - - name: Assert that file /etc/sysctl.d/ibm_largesend.conf is a regular file - assert: - that: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert.stat.isreg - fail_msg: "FAIL: File /etc/sysctl.d/ibm_largesend.conf is not a regular file!" - success_msg: "PASS: File /etc/sysctl.d/ibm_largesend.conf is a regular file." - ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - when: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert.stat.exists + - name: Assert that file /etc/sysctl.d/ibm_largesend.conf is a regular file + assert: + that: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert.stat.isreg + fail_msg: "FAIL: File /etc/sysctl.d/ibm_largesend.conf is not a regular file!" + success_msg: "PASS: File /etc/sysctl.d/ibm_largesend.conf is a regular file." + ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" + when: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert.stat.exists when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2055470|d(false) diff --git a/tasks/sapnote/assert-2292690.yml b/tasks/sapnote/assert-2292690.yml index 60d1f7e..63989ca 100644 --- a/tasks/sapnote/assert-2292690.yml +++ b/tasks/sapnote/assert-2292690.yml @@ -1,6 +1,4 @@ --- -# tasks file for sap-hana-preconfigure configuration - - name: Assert - Display SAP note number 2292690 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2292690$') | first).number }} diff --git a/tasks/sapnote/assert-2777782.yml b/tasks/sapnote/assert-2777782.yml index a58c195..8646f7a 100644 --- a/tasks/sapnote/assert-2777782.yml +++ b/tasks/sapnote/assert-2777782.yml @@ -1,12 +1,11 @@ --- -# tasks file for sap-hana-preconfigure configuration - - name: Assert - Display SAP note number 2777782 and its version debug: msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2777782$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2777782$') | first).version }}): SAP HANA settings for RHEL 8" -# Step 1: SELinux is already asserted in role sap-preconfigure. +- import_tasks: 2777782/01-assert-selinux.yml + when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2777782_01|d(false) - import_tasks: 2777782/02-assert-tuned.yml when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2777782_02|d(false) diff --git a/tests/inventory b/tests/inventory deleted file mode 100644 index 878877b..0000000 --- a/tests/inventory +++ /dev/null @@ -1,2 +0,0 @@ -localhost - diff --git a/tests/issues/118/sap-hana-preconfigure-issue-118-assert-vars.yml b/tests/issues/118/sap-hana-preconfigure-issue-118-assert-vars.yml deleted file mode 100644 index ef310fd..0000000 --- a/tests/issues/118/sap-hana-preconfigure-issue-118-assert-vars.yml +++ /dev/null @@ -1,30 +0,0 @@ -__sap_hana_preconfigure_packages: -# SAP NOTE 2772999: -# - expect -# - graphviz -# - iptraf-ng -# - krb5-workstation -# - libatomic -# - libcanberra-gtk2 -# - libibverbs -# - libicu -# - libpng12 - - libssh2 -# - lm_sensors -# - nfs-utils -# - numactl -# - PackageKit-gtk3-module -# - xorg-x11-xauth -# - bind-utils -# - cairo -# - libaio -# - krb5-libs -# - net-tools -# - openssl -# - rsyslog -# - sudo -# - xfsprogs -# - gtk2 -# - libtool-ltdl -# SAP NOTE 2777782: -# - tuned-profiles-sap-hana diff --git a/tests/issues/118/sap-hana-preconfigure-issue-118-assert.yml b/tests/issues/118/sap-hana-preconfigure-issue-118-assert.yml deleted file mode 100644 index 6c90ece..0000000 --- a/tests/issues/118/sap-hana-preconfigure-issue-118-assert.yml +++ /dev/null @@ -1,19 +0,0 @@ -- hosts: all - tasks: - - name: Check if required packages are installed - shell: yum info installed {{ __sap_hana_preconfigure_packages | map('quote') | join(' ') }} | awk '/Name/{n=$NF}/Version/{v=$NF}/Release/{r=$NF}/Description/{printf ("%s\n", n)}' - register: yum_result - changed_when: no - args: - warn: false - - - name: Assert that all required packages are installed - assert: - that: - - "'{{ line_item }}' in yum_result.stdout_lines" - fail_msg: "FAIL: Package '{{ line_item }}' is not installed!" - success_msg: "PASS: Package '{{ line_item }}' is installed." - with_items: - - "{{ __sap_hana_preconfigure_packages }}" - loop_control: - loop_var: line_item diff --git a/tests/issues/118/sap-hana-preconfigure-issue-118-prepare-test-1.yml b/tests/issues/118/sap-hana-preconfigure-issue-118-prepare-test-1.yml deleted file mode 100644 index 1e46d74..0000000 --- a/tests/issues/118/sap-hana-preconfigure-issue-118-prepare-test-1.yml +++ /dev/null @@ -1,6 +0,0 @@ -- hosts: all - tasks: - - name: Make sure that package libssh2 is not installed - package: - state: absent - name: libssh2 diff --git a/tests/issues/118/sap-hana-preconfigure-issue-118-run-tests.sh b/tests/issues/118/sap-hana-preconfigure-issue-118-run-tests.sh deleted file mode 100755 index b23dca8..0000000 --- a/tests/issues/118/sap-hana-preconfigure-issue-118-run-tests.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -MANAGED_NODE=$1 -if [[ ${MANAGED_NODE}. = "." ]]; then - echo "Enter the name of the managed node (RHEL 8 only): " - read MANAGED_NODE -fi - -echo -printf "Managed node Red Hat release: " -ssh ${MANAGED_NODE} cat /etc/redhat-release -printf "Managed node HW architecture: " -ssh ${MANAGED_NODE} uname -m -echo -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -if [[ ${_RHEL_RELEASE_MAJOR} -ne 8 ]]; then - echo "This test is only valid for RHEL 8 managed nodes. Exiting." - echo - exit 1 -fi - -# Test 1: Run the role -echo "Test 1: Remove package libssh2 if installed" -ansible-playbook sap-hana-preconfigure-issue-118-prepare-test-1.yml -l ${MANAGED_NODE} -echo -echo "Status before running the test:" -ssh ${MANAGED_NODE} "yum list installed libssh2" -echo -echo "Test 1: Run role:" -ansible-playbook sap-hana-preconfigure-issue-118-test.yml -l ${MANAGED_NODE} -echo -echo "Test 1: Assertion:" -ansible-playbook sap-hana-preconfigure-issue-118-assert.yml -l ${MANAGED_NODE} -e "@sap-hana-preconfigure-issue-118-assert-vars.yml" - diff --git a/tests/issues/118/sap-hana-preconfigure-issue-118-test.yml b/tests/issues/118/sap-hana-preconfigure-issue-118-test.yml deleted file mode 100644 index e38ecef..0000000 --- a/tests/issues/118/sap-hana-preconfigure-issue-118-test.yml +++ /dev/null @@ -1,8 +0,0 @@ -- hosts: all - vars: - sap_hana_preconfigure_config_all: no - sap_hana_preconfigure_installation: yes - sap_hana_preconfigure_configuration: no - sap_hana_preconfigure_fail_if_reboot_required: no - roles: - - role: sap-hana-preconfigure diff --git a/tests/issues/128/sap-hana-preconfigure-issue-128-assert.yml b/tests/issues/128/sap-hana-preconfigure-issue-128-assert.yml deleted file mode 100644 index 45238a3..0000000 --- a/tests/issues/128/sap-hana-preconfigure-issue-128-assert.yml +++ /dev/null @@ -1,44 +0,0 @@ -- hosts: all - tasks: - - name: Get info about file /etc/init.d/boot.local - stat: - path: /etc/init.d/boot.local - register: stat_boot_local - - - name: Assert that file /etc/init.d/boot.local exists - assert: - that: "stat_boot_local.stat.isreg == true" - fail_msg: "FAIL: The file /etc/init.d/boot.local does not exist or is no regular file!" - success_msg: "PASS: The file /etc/init.d/boot.local exists and is a regular file." - - - name: Assert that the mode of file /etc/init.d/boot.local is 0755 - assert: - that: "stat_boot_local.stat.mode == '0755'" - fail_msg: "FAIL: The file /etc/init.d/boot.local has mode '{{ stat_boot_local.stat.mode }}' but the expected mode is '0755'!" - success_msg: "PASS: The file /etc/init.d/boot.local has mode 0755." - - - name: Get KSM setting in /etc/init.d/boot.local - command: awk '/ksm/{print}' /etc/init.d/boot.local - register: awk_ksm_boot_local_result - ignore_errors: true - changed_when: no - - - name: Assert that ksm is disabled in /etc/init.d/boot.local - assert: - that: - - "'echo 0 > /sys/kernel/mm/ksm/run' in awk_ksm_boot_local_result.stdout" - fail_msg: "FAIL: The line 'echo 0 > /sys/kernel/mm/ksm/run' is not in file /etc/init.d/boot.local!" - success_msg: "PASS: The line 'echo 0 > /sys/kernel/mm/ksm/run' is in file /etc/init.d/boot.local." - - - name: Get status of KSM - command: cat /sys/kernel/mm/ksm/run - register: ksm_running_result - ignore_errors: true - changed_when: no - - - name: Assert that ksm is currently not configured - assert: - that: - - "ksm_running_result.stdout == '0'" - fail_msg: "FAIL: KSM is currently configured!" - success_msg: "PASS: KSM is not configured currently." diff --git a/tests/issues/128/sap-hana-preconfigure-issue-128-prepare-test-1.yml b/tests/issues/128/sap-hana-preconfigure-issue-128-prepare-test-1.yml deleted file mode 100644 index 4ae415a..0000000 --- a/tests/issues/128/sap-hana-preconfigure-issue-128-prepare-test-1.yml +++ /dev/null @@ -1,6 +0,0 @@ -- hosts: all - tasks: - - name: Make sure that file /etc/init.d/boot.local does not exist - file: - path: /etc/init.d/boot.local - state: absent diff --git a/tests/issues/128/sap-hana-preconfigure-issue-128-run-tests.sh b/tests/issues/128/sap-hana-preconfigure-issue-128-run-tests.sh deleted file mode 100755 index 66c251a..0000000 --- a/tests/issues/128/sap-hana-preconfigure-issue-128-run-tests.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -MANAGED_NODE=$1 -if [[ ${MANAGED_NODE}. = "." ]]; then - echo "Enter the name of the managed node: " - read MANAGED_NODE -fi - -echo -printf "Managed node Red Hat release: " -ssh ${MANAGED_NODE} cat /etc/redhat-release -printf "Managed node HW architecture: " -ssh ${MANAGED_NODE} uname -m -echo -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -# Test 1: Run the role in check mode -echo "Test 1: Remove file /etc/init.d/boot.local" -ansible-playbook sap-hana-preconfigure-issue-128-prepare-test-1.yml -l ${MANAGED_NODE} -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi -echo -echo "Status before running the test:" -ssh ${MANAGED_NODE} "ls -l /etc/init.d/boot.local" -echo -echo "Test 1: Run role in check mode:" -ansible-playbook sap-hana-preconfigure-issue-128-test.yml -l ${MANAGED_NODE} --check -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 2: Run the role in normal mode -echo -echo "Test 2: Run role in normal mode:" -ansible-playbook sap-hana-preconfigure-issue-128-test.yml -l ${MANAGED_NODE} -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi -echo -echo "Test 2: Assertion:" -ansible-playbook sap-hana-preconfigure-issue-128-assert.yml -l ${MANAGED_NODE} -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 3: Run the role in check mode again -echo "Status before running the test:" -ssh ${MANAGED_NODE} "ls -l /etc/init.d/boot.local" -echo -echo "Test 3: Run role in check mode:" -ansible-playbook sap-hana-preconfigure-issue-128-test.yml -l ${MANAGED_NODE} --check - diff --git a/tests/issues/128/sap-hana-preconfigure-issue-128-test.yml b/tests/issues/128/sap-hana-preconfigure-issue-128-test.yml deleted file mode 100644 index 285cebc..0000000 --- a/tests/issues/128/sap-hana-preconfigure-issue-128-test.yml +++ /dev/null @@ -1,10 +0,0 @@ -- hosts: all - vars: - sap_hana_preconfigure_config_all: no - sap_hana_preconfigure_installation: no - sap_hana_preconfigure_configuration: yes - sap_hana_preconfigure_2292690_07: yes - sap_hana_preconfigure_2777782_09: yes - sap_hana_preconfigure_fail_if_reboot_required: no - roles: - - role: sap-hana-preconfigure diff --git a/tests/run-tests.py b/tests/run-sap-hana-preconfigure-tests.py similarity index 99% rename from tests/run-tests.py rename to tests/run-sap-hana-preconfigure-tests.py index 410e132..b2eea2a 100755 --- a/tests/run-tests.py +++ b/tests/run-sap-hana-preconfigure-tests.py @@ -238,7 +238,7 @@ for par1 in __tests: print ('\n' + 'Test ' + par1['number'] + ': ' + par1['name']) - command = ('ansible-playbook default-settings.yml ' + command = ('ansible-playbook sap-hana-preconfigure-default-settings.yml ' + par1['command_line_parameter'] + '-l ' + _managed_node diff --git a/tests/default-settings.yml b/tests/sap-hana-preconfigure-default-settings.yml similarity index 100% rename from tests/default-settings.yml rename to tests/sap-hana-preconfigure-default-settings.yml diff --git a/tests/sapnote/2777782/01/sap-hana-preconfigure-sapnote-2777782-01-prepare-test-1.yml b/tests/sapnote/2777782/01/sap-hana-preconfigure-sapnote-2777782-01-prepare-test-1.yml deleted file mode 100644 index 270a3f0..0000000 --- a/tests/sapnote/2777782/01/sap-hana-preconfigure-sapnote-2777782-01-prepare-test-1.yml +++ /dev/null @@ -1,6 +0,0 @@ -- hosts: all - tasks: - - name: Enable SELinux - selinux: - state: enforcing - policy: targeted diff --git a/tests/sapnote/2777782/01/sap-hana-preconfigure-sapnote-2777782-01-run-tests.sh b/tests/sapnote/2777782/01/sap-hana-preconfigure-sapnote-2777782-01-run-tests.sh deleted file mode 100755 index 11acebb..0000000 --- a/tests/sapnote/2777782/01/sap-hana-preconfigure-sapnote-2777782-01-run-tests.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -export ANSIBLE_DISPLAY_SKIPPED_HOSTS="no" - -MANAGED_NODE=$1 -if [[ ${MANAGED_NODE}. = "." ]]; then - echo "Enter the name of the managed node: " - read MANAGED_NODE -fi -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -if [[ ${_RHEL_RELEASE_MAJOR} -ne 8 ]]; then - echo "This test is only valid for RHEL 8 managed nodes. Exiting." - echo - exit 1 -fi - -echo -printf "Managed node Red Hat release: " -ssh ${MANAGED_NODE} cat /etc/redhat-release -printf "Managed node HW architecture: " -ssh ${MANAGED_NODE} uname -m -echo -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -# Test 1: Run the role in check mode -echo "Test 1: Run role in check mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-01-test.yml -l ${MANAGED_NODE} --check -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 2: Run the role in normal mode -echo "Prepare for test 2: Set the system to SELinux enforcing mode" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-01-prepare-test-1.yml -l ${MANAGED_NODE} -echo -echo "Verify that the system is set to SELinux enforcing mode" -ssh ${MANAGED_NODE} getenforce -echo -echo "Test 2: Run role in normal mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-01-test.yml -l ${MANAGED_NODE} -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 3: Run the role in assert mode -echo -echo "Test 3: Run the role in assert mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-01-test.yml -l ${MANAGED_NODE} -e "{'sap_hana_preconfigure_assert': yes}" -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - diff --git a/tests/sapnote/2777782/01/sap-hana-preconfigure-sapnote-2777782-01-test.yml b/tests/sapnote/2777782/01/sap-hana-preconfigure-sapnote-2777782-01-test.yml deleted file mode 100644 index 02aef1f..0000000 --- a/tests/sapnote/2777782/01/sap-hana-preconfigure-sapnote-2777782-01-test.yml +++ /dev/null @@ -1,11 +0,0 @@ -- hosts: all - vars: - sap_hana_preconfigure_config_all: no - sap_hana_preconfigure_installation: no - sap_hana_preconfigure_configuration: yes - sap_hana_preconfigure_2777782_01: yes - sap_hana_preconfigure_fail_if_reboot_required: no - sap_hana_preconfigure_assert_all_config: yes - sap_hana_preconfigure_modify_grub_cmdline_linux: yes - roles: - - role: sap-hana-preconfigure diff --git a/tests/sapnote/2777782/02/sap-hana-preconfigure-sapnote-2777782-02-run-tests.sh b/tests/sapnote/2777782/02/sap-hana-preconfigure-sapnote-2777782-02-run-tests.sh deleted file mode 100755 index e999531..0000000 --- a/tests/sapnote/2777782/02/sap-hana-preconfigure-sapnote-2777782-02-run-tests.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -export ANSIBLE_DISPLAY_SKIPPED_HOSTS="no" - -MANAGED_NODE=$1 -if [[ ${MANAGED_NODE}. = "." ]]; then - echo "Enter the name of the managed node: " - read MANAGED_NODE -fi -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -if [[ ${_RHEL_RELEASE_MAJOR} -ne 8 ]]; then - echo "This test is only valid for RHEL 8 managed nodes. Exiting." - echo - exit 1 -fi - -echo -printf "Managed node Red Hat release: " -ssh ${MANAGED_NODE} cat /etc/redhat-release -printf "Managed node HW architecture: " -ssh ${MANAGED_NODE} uname -m -echo -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -# Test 1: Run the role in check mode -echo "Test 1: Run role in check mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-02-test.yml -l ${MANAGED_NODE} --check -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 2: Run the role in normal mode -echo -echo "Test 2: Run role in normal mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-02-test.yml -l ${MANAGED_NODE} -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 3: Run the role in assert mode -echo -echo "Test 3: Run the role in assert mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-02-test.yml -l ${MANAGED_NODE} -e "{'sap_hana_preconfigure_assert': yes}" -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - diff --git a/tests/sapnote/2777782/02/sap-hana-preconfigure-sapnote-2777782-02-test.yml b/tests/sapnote/2777782/02/sap-hana-preconfigure-sapnote-2777782-02-test.yml deleted file mode 100644 index a522e13..0000000 --- a/tests/sapnote/2777782/02/sap-hana-preconfigure-sapnote-2777782-02-test.yml +++ /dev/null @@ -1,11 +0,0 @@ -- hosts: all - vars: - sap_hana_preconfigure_config_all: no - sap_hana_preconfigure_installation: no - sap_hana_preconfigure_configuration: yes - sap_hana_preconfigure_2777782_02: yes - sap_hana_preconfigure_fail_if_reboot_required: no - sap_hana_preconfigure_assert_all_config: yes - sap_hana_preconfigure_modify_grub_cmdline_linux: yes - roles: - - role: sap-hana-preconfigure diff --git a/tests/sapnote/2777782/03/sap-hana-preconfigure-sapnote-2777782-03-run-tests.sh b/tests/sapnote/2777782/03/sap-hana-preconfigure-sapnote-2777782-03-run-tests.sh deleted file mode 100755 index adc24dc..0000000 --- a/tests/sapnote/2777782/03/sap-hana-preconfigure-sapnote-2777782-03-run-tests.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -export ANSIBLE_DISPLAY_SKIPPED_HOSTS="no" - -MANAGED_NODE=$1 -if [[ ${MANAGED_NODE}. = "." ]]; then - echo "Enter the name of the managed node: " - read MANAGED_NODE -fi -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -if [[ ${_RHEL_RELEASE_MAJOR} -ne 8 ]]; then - echo "This test is only valid for RHEL 8 managed nodes. Exiting." - echo - exit 1 -fi - -echo -printf "Managed node Red Hat release: " -ssh ${MANAGED_NODE} cat /etc/redhat-release -printf "Managed node HW architecture: " -ssh ${MANAGED_NODE} uname -m -echo -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -# Test 1: Run the role in check mode -echo "Test 1: Run role in check mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-03-test.yml -l ${MANAGED_NODE} --check -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 2: Run the role in normal mode -echo -echo "Test 2: Run role in normal mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-03-test.yml -l ${MANAGED_NODE} -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 3: Run the role in assert mode -echo -echo "Test 3: Run the role in assert mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-03-test.yml -l ${MANAGED_NODE} -e "{'sap_hana_preconfigure_assert': yes}" -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - diff --git a/tests/sapnote/2777782/03/sap-hana-preconfigure-sapnote-2777782-03-test.yml b/tests/sapnote/2777782/03/sap-hana-preconfigure-sapnote-2777782-03-test.yml deleted file mode 100644 index 743d163..0000000 --- a/tests/sapnote/2777782/03/sap-hana-preconfigure-sapnote-2777782-03-test.yml +++ /dev/null @@ -1,11 +0,0 @@ -- hosts: all - vars: - sap_hana_preconfigure_config_all: no - sap_hana_preconfigure_installation: no - sap_hana_preconfigure_configuration: yes - sap_hana_preconfigure_2777782_03: yes - sap_hana_preconfigure_fail_if_reboot_required: no - sap_hana_preconfigure_assert_all_config: yes - sap_hana_preconfigure_modify_grub_cmdline_linux: yes - roles: - - role: sap-hana-preconfigure diff --git a/tests/sapnote/2777782/04/sap-hana-preconfigure-sapnote-2777782-04-run-tests.sh b/tests/sapnote/2777782/04/sap-hana-preconfigure-sapnote-2777782-04-run-tests.sh deleted file mode 100755 index 627e197..0000000 --- a/tests/sapnote/2777782/04/sap-hana-preconfigure-sapnote-2777782-04-run-tests.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -export ANSIBLE_DISPLAY_SKIPPED_HOSTS="no" - -MANAGED_NODE=$1 -if [[ ${MANAGED_NODE}. = "." ]]; then - echo "Enter the name of the managed node: " - read MANAGED_NODE -fi -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -if [[ ${_RHEL_RELEASE_MAJOR} -ne 8 ]]; then - echo "This test is only valid for RHEL 8 managed nodes. Exiting." - echo - exit 1 -fi - -echo -printf "Managed node Red Hat release: " -ssh ${MANAGED_NODE} cat /etc/redhat-release -printf "Managed node HW architecture: " -ssh ${MANAGED_NODE} uname -m -echo -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -# Test 1: Run the role in check mode -echo "Test 1: Run role in check mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-04-test.yml -l ${MANAGED_NODE} --check -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 2: Run the role in normal mode -echo -echo "Test 2: Run role in normal mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-04-test.yml -l ${MANAGED_NODE} -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 3: Run the role in assert mode -echo -echo "Test 3: Run the role in assert mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-04-test.yml -l ${MANAGED_NODE} -e "{'sap_hana_preconfigure_assert': yes}" -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - diff --git a/tests/sapnote/2777782/04/sap-hana-preconfigure-sapnote-2777782-04-test.yml b/tests/sapnote/2777782/04/sap-hana-preconfigure-sapnote-2777782-04-test.yml deleted file mode 100644 index 545d4b7..0000000 --- a/tests/sapnote/2777782/04/sap-hana-preconfigure-sapnote-2777782-04-test.yml +++ /dev/null @@ -1,11 +0,0 @@ -- hosts: all - vars: - sap_hana_preconfigure_config_all: no - sap_hana_preconfigure_installation: no - sap_hana_preconfigure_configuration: yes - sap_hana_preconfigure_2777782_04: yes - sap_hana_preconfigure_fail_if_reboot_required: no - sap_hana_preconfigure_assert_all_config: yes - sap_hana_preconfigure_modify_grub_cmdline_linux: yes - roles: - - role: sap-hana-preconfigure diff --git a/tests/sapnote/2777782/05/sap-hana-preconfigure-sapnote-2777782-05-run-tests.sh b/tests/sapnote/2777782/05/sap-hana-preconfigure-sapnote-2777782-05-run-tests.sh deleted file mode 100755 index f8e5009..0000000 --- a/tests/sapnote/2777782/05/sap-hana-preconfigure-sapnote-2777782-05-run-tests.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -export ANSIBLE_DISPLAY_SKIPPED_HOSTS="no" - -MANAGED_NODE=$1 -if [[ ${MANAGED_NODE}. = "." ]]; then - echo "Enter the name of the managed node: " - read MANAGED_NODE -fi -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -if [[ ${_RHEL_RELEASE_MAJOR} -ne 8 ]]; then - echo "This test is only valid for RHEL 8 managed nodes. Exiting." - echo - exit 1 -fi - -echo -printf "Managed node Red Hat release: " -ssh ${MANAGED_NODE} cat /etc/redhat-release -printf "Managed node HW architecture: " -ssh ${MANAGED_NODE} uname -m -echo -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -# Test 1: Run the role in check mode -echo "Test 1: Run role in check mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-05-test.yml -l ${MANAGED_NODE} --check -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 2: Run the role in normal mode -echo -echo "Test 2: Run role in normal mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-05-test.yml -l ${MANAGED_NODE} -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 3: Run the role in assert mode -echo -echo "Test 3: Run the role in assert mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-05-test.yml -l ${MANAGED_NODE} -e "{'sap_hana_preconfigure_assert': yes}" -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - diff --git a/tests/sapnote/2777782/05/sap-hana-preconfigure-sapnote-2777782-05-test.yml b/tests/sapnote/2777782/05/sap-hana-preconfigure-sapnote-2777782-05-test.yml deleted file mode 100644 index ba1cadb..0000000 --- a/tests/sapnote/2777782/05/sap-hana-preconfigure-sapnote-2777782-05-test.yml +++ /dev/null @@ -1,11 +0,0 @@ -- hosts: all - vars: - sap_hana_preconfigure_config_all: no - sap_hana_preconfigure_installation: no - sap_hana_preconfigure_configuration: yes - sap_hana_preconfigure_2777782_05: yes - sap_hana_preconfigure_fail_if_reboot_required: no - sap_hana_preconfigure_assert_all_config: yes - sap_hana_preconfigure_modify_grub_cmdline_linux: yes - roles: - - role: sap-hana-preconfigure diff --git a/tests/sapnote/2777782/06/sap-hana-preconfigure-sapnote-2777782-06-run-tests.sh b/tests/sapnote/2777782/06/sap-hana-preconfigure-sapnote-2777782-06-run-tests.sh deleted file mode 100755 index ab3a697..0000000 --- a/tests/sapnote/2777782/06/sap-hana-preconfigure-sapnote-2777782-06-run-tests.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -export ANSIBLE_DISPLAY_SKIPPED_HOSTS="no" - -MANAGED_NODE=$1 -if [[ ${MANAGED_NODE}. = "." ]]; then - echo "Enter the name of the managed node: " - read MANAGED_NODE -fi -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -if [[ ${_RHEL_RELEASE_MAJOR} -ne 8 ]]; then - echo "This test is only valid for RHEL 8 managed nodes. Exiting." - echo - exit 1 -fi - -echo -printf "Managed node Red Hat release: " -ssh ${MANAGED_NODE} cat /etc/redhat-release -printf "Managed node HW architecture: " -ssh ${MANAGED_NODE} uname -m -echo -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -# Test 1: Run the role in check mode -echo "Test 1: Run role in check mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-06-test.yml -l ${MANAGED_NODE} --check -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 2: Run the role in normal mode -echo -echo "Test 2: Run role in normal mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-06-test.yml -l ${MANAGED_NODE} -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 3: Run the role in assert mode -echo -echo "Test 3: Run the role in assert mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-06-test.yml -l ${MANAGED_NODE} -e "{'sap_hana_preconfigure_assert': yes}" -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - diff --git a/tests/sapnote/2777782/06/sap-hana-preconfigure-sapnote-2777782-06-test.yml b/tests/sapnote/2777782/06/sap-hana-preconfigure-sapnote-2777782-06-test.yml deleted file mode 100644 index b1d7079..0000000 --- a/tests/sapnote/2777782/06/sap-hana-preconfigure-sapnote-2777782-06-test.yml +++ /dev/null @@ -1,11 +0,0 @@ -- hosts: all - vars: - sap_hana_preconfigure_config_all: no - sap_hana_preconfigure_installation: no - sap_hana_preconfigure_configuration: yes - sap_hana_preconfigure_2777782_06: yes - sap_hana_preconfigure_fail_if_reboot_required: no - sap_hana_preconfigure_assert_all_config: yes - sap_hana_preconfigure_modify_grub_cmdline_linux: yes - roles: - - role: sap-hana-preconfigure diff --git a/tests/sapnote/2777782/07/sap-hana-preconfigure-sapnote-2777782-07-run-tests.sh b/tests/sapnote/2777782/07/sap-hana-preconfigure-sapnote-2777782-07-run-tests.sh deleted file mode 100755 index 1317de8..0000000 --- a/tests/sapnote/2777782/07/sap-hana-preconfigure-sapnote-2777782-07-run-tests.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -export ANSIBLE_DISPLAY_SKIPPED_HOSTS="no" - -MANAGED_NODE=$1 -if [[ ${MANAGED_NODE}. = "." ]]; then - echo "Enter the name of the managed node: " - read MANAGED_NODE -fi -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -if [[ ${_RHEL_RELEASE_MAJOR} -ne 8 ]]; then - echo "This test is only valid for RHEL 8 managed nodes. Exiting." - echo - exit 1 -fi - -echo -printf "Managed node Red Hat release: " -ssh ${MANAGED_NODE} cat /etc/redhat-release -printf "Managed node HW architecture: " -ssh ${MANAGED_NODE} uname -m -echo -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -# Test 1: Run the role in check mode -echo "Test 1: Run role in check mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-07-test.yml -l ${MANAGED_NODE} --check -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 2: Run the role in normal mode -echo -echo "Test 2: Run role in normal mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-07-test.yml -l ${MANAGED_NODE} -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 3: Run the role in assert mode -echo -echo "Test 3: Run the role in assert mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-07-test.yml -l ${MANAGED_NODE} -e "{'sap_hana_preconfigure_assert': yes}" -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - diff --git a/tests/sapnote/2777782/07/sap-hana-preconfigure-sapnote-2777782-07-test.yml b/tests/sapnote/2777782/07/sap-hana-preconfigure-sapnote-2777782-07-test.yml deleted file mode 100644 index 4cdf2cf..0000000 --- a/tests/sapnote/2777782/07/sap-hana-preconfigure-sapnote-2777782-07-test.yml +++ /dev/null @@ -1,11 +0,0 @@ -- hosts: all - vars: - sap_hana_preconfigure_config_all: no - sap_hana_preconfigure_installation: no - sap_hana_preconfigure_configuration: yes - sap_hana_preconfigure_2777782_07: yes - sap_hana_preconfigure_fail_if_reboot_required: no - sap_hana_preconfigure_assert_all_config: yes - sap_hana_preconfigure_modify_grub_cmdline_linux: yes - roles: - - role: sap-hana-preconfigure diff --git a/tests/sapnote/2777782/08/sap-hana-preconfigure-sapnote-2777782-08-run-tests.sh b/tests/sapnote/2777782/08/sap-hana-preconfigure-sapnote-2777782-08-run-tests.sh deleted file mode 100755 index 7077a72..0000000 --- a/tests/sapnote/2777782/08/sap-hana-preconfigure-sapnote-2777782-08-run-tests.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -export ANSIBLE_DISPLAY_SKIPPED_HOSTS="no" - -MANAGED_NODE=$1 -if [[ ${MANAGED_NODE}. = "." ]]; then - echo "Enter the name of the managed node: " - read MANAGED_NODE -fi -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -if [[ ${_RHEL_RELEASE_MAJOR} -ne 8 ]]; then - echo "This test is only valid for RHEL 8 managed nodes. Exiting." - echo - exit 1 -fi - -echo -printf "Managed node Red Hat release: " -ssh ${MANAGED_NODE} cat /etc/redhat-release -printf "Managed node HW architecture: " -ssh ${MANAGED_NODE} uname -m -echo -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -# Test 1: Run the role in check mode -echo "Test 1: Run role in check mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-08-test.yml -l ${MANAGED_NODE} --check -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 2: Run the role in normal mode -echo -echo "Test 2: Run role in normal mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-08-test.yml -l ${MANAGED_NODE} -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 3: Run the role in assert mode -echo -echo "Test 3: Run the role in assert mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-08-test.yml -l ${MANAGED_NODE} -e "{'sap_hana_preconfigure_assert': yes}" -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - diff --git a/tests/sapnote/2777782/08/sap-hana-preconfigure-sapnote-2777782-08-test.yml b/tests/sapnote/2777782/08/sap-hana-preconfigure-sapnote-2777782-08-test.yml deleted file mode 100644 index 92d7405..0000000 --- a/tests/sapnote/2777782/08/sap-hana-preconfigure-sapnote-2777782-08-test.yml +++ /dev/null @@ -1,11 +0,0 @@ -- hosts: all - vars: - sap_hana_preconfigure_config_all: no - sap_hana_preconfigure_installation: no - sap_hana_preconfigure_configuration: yes - sap_hana_preconfigure_2777782_08: yes - sap_hana_preconfigure_fail_if_reboot_required: no - sap_hana_preconfigure_assert_all_config: yes - sap_hana_preconfigure_modify_grub_cmdline_linux: yes - roles: - - role: sap-hana-preconfigure diff --git a/tests/sapnote/2777782/09/sap-hana-preconfigure-sapnote-2777782-09-run-tests.sh b/tests/sapnote/2777782/09/sap-hana-preconfigure-sapnote-2777782-09-run-tests.sh deleted file mode 100755 index 093dd24..0000000 --- a/tests/sapnote/2777782/09/sap-hana-preconfigure-sapnote-2777782-09-run-tests.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -export ANSIBLE_DISPLAY_SKIPPED_HOSTS="no" - -MANAGED_NODE=$1 -if [[ ${MANAGED_NODE}. = "." ]]; then - echo "Enter the name of the managed node: " - read MANAGED_NODE -fi -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -if [[ ${_RHEL_RELEASE_MAJOR} -ne 8 ]]; then - echo "This test is only valid for RHEL 8 managed nodes. Exiting." - echo - exit 1 -fi - -echo -printf "Managed node Red Hat release: " -ssh ${MANAGED_NODE} cat /etc/redhat-release -printf "Managed node HW architecture: " -ssh ${MANAGED_NODE} uname -m -echo -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -# Test 1: Run the role in check mode -echo "Test 1: Run role in check mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-09-test.yml -l ${MANAGED_NODE} --check -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 2: Run the role in normal mode -echo -echo "Test 2: Run role in normal mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-09-test.yml -l ${MANAGED_NODE} -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 3: Run the role in assert mode -echo -echo "Test 3: Run the role in assert mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-09-test.yml -l ${MANAGED_NODE} -e "{'sap_hana_preconfigure_assert': yes}" -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - diff --git a/tests/sapnote/2777782/09/sap-hana-preconfigure-sapnote-2777782-09-test.yml b/tests/sapnote/2777782/09/sap-hana-preconfigure-sapnote-2777782-09-test.yml deleted file mode 100644 index a24fe0f..0000000 --- a/tests/sapnote/2777782/09/sap-hana-preconfigure-sapnote-2777782-09-test.yml +++ /dev/null @@ -1,11 +0,0 @@ -- hosts: all - vars: - sap_hana_preconfigure_config_all: no - sap_hana_preconfigure_installation: no - sap_hana_preconfigure_configuration: yes - sap_hana_preconfigure_2777782_09: yes - sap_hana_preconfigure_fail_if_reboot_required: no - sap_hana_preconfigure_assert_all_config: yes - sap_hana_preconfigure_modify_grub_cmdline_linux: yes - roles: - - role: sap-hana-preconfigure diff --git a/tests/sapnote/2777782/10/sap-hana-preconfigure-sapnote-2777782-10-run-tests.sh b/tests/sapnote/2777782/10/sap-hana-preconfigure-sapnote-2777782-10-run-tests.sh deleted file mode 100755 index efce92f..0000000 --- a/tests/sapnote/2777782/10/sap-hana-preconfigure-sapnote-2777782-10-run-tests.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -export ANSIBLE_DISPLAY_SKIPPED_HOSTS="no" - -MANAGED_NODE=$1 -if [[ ${MANAGED_NODE}. = "." ]]; then - echo "Enter the name of the managed node: " - read MANAGED_NODE -fi -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -if [[ ${_RHEL_RELEASE_MAJOR} -ne 8 ]]; then - echo "This test is only valid for RHEL 8 managed nodes. Exiting." - echo - exit 1 -fi - -echo -printf "Managed node Red Hat release: " -ssh ${MANAGED_NODE} cat /etc/redhat-release -printf "Managed node HW architecture: " -ssh ${MANAGED_NODE} uname -m -echo -_RHEL_RELEASE_MAJOR=$(ssh ${MANAGED_NODE} cat /etc/redhat-release | awk 'BEGIN{FS="release "}{split ($2, a, " "); split (a[1], b, "."); print b[1]}') - -# Test 1: Run the role in check mode -echo "Test 1: Run role in check mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-10-test.yml -l ${MANAGED_NODE} --check -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 2: Run the role in normal mode -echo -echo "Test 2: Run role in normal mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-10-test.yml -l ${MANAGED_NODE} -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - -# Test 3: Run the role in assert mode -echo -echo "Test 3: Run the role in assert mode:" -ansible-playbook sap-hana-preconfigure-sapnote-2777782-10-test.yml -l ${MANAGED_NODE} -e "{'sap_hana_preconfigure_assert': yes}" -RC=$? -echo "RC=${RC}" -if [[ ${RC} -ne 0 ]]; then - exit ${RC} -fi - diff --git a/tests/sapnote/2777782/10/sap-hana-preconfigure-sapnote-2777782-10-test.yml b/tests/sapnote/2777782/10/sap-hana-preconfigure-sapnote-2777782-10-test.yml deleted file mode 100644 index e0c66a7..0000000 --- a/tests/sapnote/2777782/10/sap-hana-preconfigure-sapnote-2777782-10-test.yml +++ /dev/null @@ -1,11 +0,0 @@ -- hosts: all - vars: - sap_hana_preconfigure_config_all: no - sap_hana_preconfigure_installation: no - sap_hana_preconfigure_configuration: yes - sap_hana_preconfigure_2777782_10: yes - sap_hana_preconfigure_fail_if_reboot_required: no - sap_hana_preconfigure_assert_all_config: yes - sap_hana_preconfigure_modify_grub_cmdline_linux: yes - roles: - - role: sap-hana-preconfigure diff --git a/tests/test.yml b/tests/test.yml deleted file mode 100644 index 1e66337..0000000 --- a/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - sap-hana-preconfigure diff --git a/vars/RedHat_7.yml b/vars/RedHat_7.yml index ae9ea81..b3e5cdf 100644 --- a/vars/RedHat_7.yml +++ b/vars/RedHat_7.yml @@ -7,46 +7,39 @@ __sap_hana_preconfigure_supported_rhel_minor_releases: - "7.9" # required repos for RHEL 7: -__sap_hana_preconfigure_req_repos_RedHat_7_6_x86_64: +__sap_hana_preconfigure_req_repos_redhat_7_6_x86_64: - "rhel-7-server-e4s-rpms" - "rhel-sap-hana-for-rhel-7-server-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_7_6_ppc64le: +__sap_hana_preconfigure_req_repos_redhat_7_6_ppc64le: - "rhel-7-for-power-le-e4s-rpms" - "rhel-sap-hana-for-rhel-7-for-power-le-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_7_7_x86_64: +__sap_hana_preconfigure_req_repos_redhat_7_7_x86_64: - "rhel-7-server-e4s-rpms" - "rhel-sap-hana-for-rhel-7-server-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_7_7_ppc64le: +__sap_hana_preconfigure_req_repos_redhat_7_7_ppc64le: - "rhel-7-for-power-le-e4s-rpms" - "rhel-sap-hana-for-rhel-7-for-power-le-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_7_8_x86_64: +__sap_hana_preconfigure_req_repos_redhat_7_8_x86_64: - "rhel-7-server-rpms" - "rhel-sap-hana-for-rhel-7-server-rpms" -__sap_hana_preconfigure_req_repos_RedHat_7_8_ppc64le: +__sap_hana_preconfigure_req_repos_redhat_7_8_ppc64le: - "rhel-7-for-power-le-rpms" - "rhel-sap-hana-for-rhel-7-for-power-le-rpms" -__sap_hana_preconfigure_req_repos_RedHat_7_9_x86_64: +__sap_hana_preconfigure_req_repos_redhat_7_9_x86_64: - "rhel-7-server-rpms" - "rhel-sap-hana-for-rhel-7-server-rpms" -__sap_hana_preconfigure_req_repos_RedHat_7_9_ppc64le: +__sap_hana_preconfigure_req_repos_redhat_7_9_ppc64le: - "rhel-7-for-power-le-rpms" - "rhel-sap-hana-for-rhel-7-for-power-le-rpms" # required SAP notes for RHEL 7: -__sap_hana_preconfigure_sapnotes: - - "2009879" - - "{% if ansible_architecture == 'ppc64le' %}2055470{% endif %}" - - "2292690" - - "2382421" - - "3024346" - __sap_hana_preconfigure_sapnotes_versions_x86_64: - { number: '2009879', version: '28' } - { number: '2292690', version: '38' } @@ -68,31 +61,31 @@ __sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars','__sap_hana_preconf # variable __sap_hana_preconfigure_min_pkgs will be undefined as well. __sap_hana_preconfigure_min_packages_7_2_x86_64: - - [ 'kernel' , '3.10.0-327.62.4.el7' ] - - [ 'systemd' , '219-19.el7_2.4' ] + - [ 'kernel', '3.10.0-327.62.4.el7' ] + - [ 'systemd', '219-19.el7_2.4' ] __sap_hana_preconfigure_min_packages_7_2_ppc64le: - - [ 'kernel' , '3.10.0-327.62.4.el7' ] - - [ 'systemd' , '219-19.el7_2.4' ] + - [ 'kernel', '3.10.0-327.62.4.el7' ] + - [ 'systemd', '219-19.el7_2.4' ] __sap_hana_preconfigure_min_packages_7_3_x86_64: - - [ 'kernel' , '3.10.0-514.36.5.el7' ] - - [ 'glibc' , '2.17-157.el7_3.5' ] - - [ 'tuned-profiles-sap-hana' , '2.7.1-3.el7_3.3' ] + - [ 'kernel', '3.10.0-514.36.5.el7' ] + - [ 'glibc', '2.17-157.el7_3.5' ] + - [ 'tuned-profiles-sap-hana', '2.7.1-3.el7_3.3' ] __sap_hana_preconfigure_min_packages_7_3_ppc64le: - - [ 'kernel' , '3.10.0-514.36.5.el7' ] - - [ 'glibc' , '2.17-157.el7_3.5' ] - - [ 'tuned-profiles-sap-hana' , '2.7.1-3.el7_3.3' ] + - [ 'kernel', '3.10.0-514.36.5.el7' ] + - [ 'glibc', '2.17-157.el7_3.5' ] + - [ 'tuned-profiles-sap-hana', '2.7.1-3.el7_3.3' ] # Attention: SAP note 2812427 requires more recent package kernel-3.10.0-693.58.1, covered by role sap-preconfigure __sap_hana_preconfigure_min_packages_7_4_x86_64: - - [ 'kernel' , '3.10.0-693.11.6.el7' ] - - [ 'tuned-profiles-sap-hana' , '2.8.0-5.el7_4.2' ] + - [ 'kernel', '3.10.0-693.11.6.el7' ] + - [ 'tuned-profiles-sap-hana', '2.8.0-5.el7_4.2' ] __sap_hana_preconfigure_min_packages_7_4_ppc64le: - - [ 'kernel' , '3.10.0-693.11.6.el7' ] - - [ 'tuned-profiles-sap-hana' , '2.8.0-5.el7_4.2' ] + - [ 'kernel', '3.10.0-693.11.6.el7' ] + - [ 'tuned-profiles-sap-hana', '2.8.0-5.el7_4.2' ] __sap_hana_preconfigure_min_packages_7_5_x86_64: @@ -100,27 +93,27 @@ __sap_hana_preconfigure_min_packages_7_5_ppc64le: # Attention: SAP note 2812427 requires more recent package kernel-3.10.0-957.35.1, covered by role sap-preconfigure __sap_hana_preconfigure_min_packages_7_6_x86_64: - - [ 'kernel' , '3.10.0-957.1.3.el7' ] + - [ 'kernel', '3.10.0-957.1.3.el7' ] __sap_hana_preconfigure_min_packages_7_6_ppc64le: - - [ 'kernel' , '3.10.0-957.1.3.el7' ] + - [ 'kernel', '3.10.0-957.1.3.el7' ] # SAP note 2292690: __sap_hana_preconfigure_min_packages_7_7_x86_64: - - [ 'kernel' , '3.10.0-1062.21.1.el7' ] + - [ 'kernel', '3.10.0-1062.21.1.el7' ] __sap_hana_preconfigure_min_packages_7_7_ppc64le: - - [ 'kernel' , '3.10.0-1062.26.1.el7' ] + - [ 'kernel', '3.10.0-1062.26.1.el7' ] __sap_hana_preconfigure_min_packages_7_8_x86_64: __sap_hana_preconfigure_min_packages_7_8_ppc64le: __sap_hana_preconfigure_min_packages_7_9_x86_64: - - [ 'kernel' , '3.10.0-1160.11.1.el7' ] + - [ 'kernel', '3.10.0-1160.11.1.el7' ] __sap_hana_preconfigure_min_packages_7_9_ppc64le: - - [ 'kernel' , '3.10.0-1160.11.1.el7' ] + - [ '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) }}" @@ -188,7 +181,7 @@ __sap_hana_preconfigure_required_ppc64le: - libstdc++ - zlib - iprutils - - lsvpd + - lsvpd - libvpd - libservicelog - servicelog @@ -225,11 +218,11 @@ __sap_hana_preconfigure_kernel_parameters_default: # Network related kernel parameters for ppc64le: __sap_hana_preconfigure_kernel_parameters_default_ppc64le: - - { name: net.core.rmem_max, value: 56623104 } - - { name: net.core.wmem_max, value: 56623104 } - - { name: net.ipv4.tcp_rmem, value: "65536 262088 56623104" } - - { name: net.ipv4.tcp_wmem, value: "65536 262088 56623104" } - - { name: net.ipv4.tcp_mem, value: "56623104 56623104 56623104" } + - { name: net.core.rmem_max, value: 56623104 } + - { name: net.core.wmem_max, value: 56623104 } + - { name: net.ipv4.tcp_rmem, value: "65536 262088 56623104" } + - { name: net.ipv4.tcp_wmem, value: "65536 262088 56623104" } + - { name: net.ipv4.tcp_mem, value: "56623104 56623104 56623104" } # Network related kernel parameters for NetApp NFS, as set in SAP Note 3024346: __sap_hana_preconfigure_kernel_parameters_netapp_nfs: @@ -247,9 +240,11 @@ __sap_hana_preconfigure_kernel_parameters_netapp_nfs: # - { name: net.ipv4.tcp_timestamps, value: 1 } - { name: net.ipv4.tcp_sack, value: 1 } +# yamllint disable rule:commas rule:colons __sap_hana_preconfigure_packages_and_services: abrtd: { pkg: 'abrt', svc: 'abrtd', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } abrt-ccpp: { pkg: 'abrt-addon-ccpp', svc: 'abrt-ccpp', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } numad: { pkg: 'numad', svc: 'numad', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } kdump: { pkg: 'kexec-tools', svc: 'kdump', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } firewalld: { pkg: 'firewalld', svc: 'firewalld', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } +# yamllint enable rule:commas rule:colons diff --git a/vars/RedHat_8.yml b/vars/RedHat_8.yml index c7989e3..3ce6f17 100644 --- a/vars/RedHat_8.yml +++ b/vars/RedHat_8.yml @@ -8,111 +8,105 @@ __sap_hana_preconfigure_supported_rhel_minor_releases: - "8.4" # required repos for RHEL 8: -__sap_hana_preconfigure_req_repos_RedHat_8_0_x86_64: +__sap_hana_preconfigure_req_repos_redhat_8_0_x86_64: - "rhel-8-for-x86_64-baseos-e4s-rpms" - "rhel-8-for-x86_64-appstream-e4s-rpms" - "rhel-8-for-x86_64-sap-solutions-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_0_ppc64le: +__sap_hana_preconfigure_req_repos_redhat_8_0_ppc64le: - "rhel-8-for-ppc64le-baseos-e4s-rpms" - "rhel-8-for-ppc64le-appstream-e4s-rpms" - "rhel-8-for-ppc64le-sap-solutions-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_1_x86_64: +__sap_hana_preconfigure_req_repos_redhat_8_1_x86_64: - "rhel-8-for-x86_64-baseos-e4s-rpms" - "rhel-8-for-x86_64-appstream-e4s-rpms" - "rhel-8-for-x86_64-sap-solutions-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_1_ppc64le: +__sap_hana_preconfigure_req_repos_redhat_8_1_ppc64le: - "rhel-8-for-ppc64le-baseos-e4s-rpms" - "rhel-8-for-ppc64le-appstream-e4s-rpms" - "rhel-8-for-ppc64le-sap-solutions-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_2_x86_64: +__sap_hana_preconfigure_req_repos_redhat_8_2_x86_64: - "rhel-8-for-x86_64-baseos-e4s-rpms" - "rhel-8-for-x86_64-appstream-e4s-rpms" - "rhel-8-for-x86_64-sap-solutions-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_2_ppc64le: +__sap_hana_preconfigure_req_repos_redhat_8_2_ppc64le: - "rhel-8-for-ppc64le-baseos-e4s-rpms" - "rhel-8-for-ppc64le-appstream-e4s-rpms" - "rhel-8-for-ppc64le-sap-solutions-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_3_x86_64: +__sap_hana_preconfigure_req_repos_redhat_8_3_x86_64: - "rhel-8-for-x86_64-baseos-rpms" - "rhel-8-for-x86_64-appstream-rpms" - "rhel-8-for-x86_64-sap-solutions-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_3_ppc64le: +__sap_hana_preconfigure_req_repos_redhat_8_3_ppc64le: - "rhel-8-for-ppc64le-baseos-rpms" - "rhel-8-for-ppc64le-appstream-rpms" - "rhel-8-for-ppc64le-sap-solutions-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_4_x86_64: +__sap_hana_preconfigure_req_repos_redhat_8_4_x86_64: - "rhel-8-for-x86_64-baseos-e4s-rpms" - "rhel-8-for-x86_64-appstream-e4s-rpms" - "rhel-8-for-x86_64-sap-solutions-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_4_ppc64le: +__sap_hana_preconfigure_req_repos_redhat_8_4_ppc64le: - "rhel-8-for-ppc64le-baseos-e4s-rpms" - "rhel-8-for-ppc64le-appstream-e4s-rpms" - "rhel-8-for-ppc64le-sap-solutions-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_5_x86_64: +__sap_hana_preconfigure_req_repos_redhat_8_5_x86_64: - "rhel-8-for-x86_64-baseos-rpms" - "rhel-8-for-x86_64-appstream-rpms" - "rhel-8-for-x86_64-sap-solutions-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_5_ppc64le: +__sap_hana_preconfigure_req_repos_redhat_8_5_ppc64le: - "rhel-8-for-ppc64le-baseos-rpms" - "rhel-8-for-ppc64le-appstream-rpms" - "rhel-8-for-ppc64le-sap-solutions-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_6_x86_64: +__sap_hana_preconfigure_req_repos_redhat_8_6_x86_64: - "rhel-8-for-x86_64-baseos-e4s-rpms" - "rhel-8-for-x86_64-appstream-e4s-rpms" - "rhel-8-for-x86_64-sap-solutions-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_6_ppc64le: +__sap_hana_preconfigure_req_repos_redhat_8_6_ppc64le: - "rhel-8-for-ppc64le-baseos-e4s-rpms" - "rhel-8-for-ppc64le-appstream-e4s-rpms" - "rhel-8-for-ppc64le-sap-solutions-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_7_x86_64: +__sap_hana_preconfigure_req_repos_redhat_8_7_x86_64: - "rhel-8-for-x86_64-baseos-rpms" - "rhel-8-for-x86_64-appstream-rpms" - "rhel-8-for-x86_64-sap-solutions-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_7_ppc64le: +__sap_hana_preconfigure_req_repos_redhat_8_7_ppc64le: - "rhel-8-for-ppc64le-baseos-rpms" - "rhel-8-for-ppc64le-appstream-rpms" - "rhel-8-for-ppc64le-sap-solutions-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_8_x86_64: +__sap_hana_preconfigure_req_repos_redhat_8_8_x86_64: - "rhel-8-for-x86_64-baseos-e4s-rpms" - "rhel-8-for-x86_64-appstream-e4s-rpms" - "rhel-8-for-x86_64-sap-solutions-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_8_8_ppc64le: +__sap_hana_preconfigure_req_repos_redhat_8_8_ppc64le: - "rhel-8-for-ppc64le-baseos-e4s-rpms" - "rhel-8-for-ppc64le-appstream-e4s-rpms" - "rhel-8-for-ppc64le-sap-solutions-e4s-rpms" # required SAP notes for RHEL 8: -__sap_hana_preconfigure_sapnotes: - - "{% if ansible_architecture == 'ppc64le' %}2055470{% endif %}" - - "2777782" - - "2382421" - - "3024346" - __sap_hana_preconfigure_sapnotes_versions_x86_64: - - { number: '2777782', version: '23' } + - { number: '2777782', version: '24' } - { number: '2382421', version: '40' } - { number: '3024346', version: '3' } __sap_hana_preconfigure_sapnotes_versions_ppc64le: - { number: '2055470', version: '85' } - - { number: '2777782', version: '23' } + - { number: '2777782', version: '24' } - { number: '2382421', version: '40' } - { number: '3024346', version: '3' } @@ -128,30 +122,30 @@ __sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars','__sap_hana_preconf __sap_hana_preconfigure_min_packages_8_0_x86_64: __sap_hana_preconfigure_min_packages_8_0_ppc64le: - - [ 'kernel' , '4.18.0-80.15.1.el8_0' ] + - [ 'kernel', '4.18.0-80.15.1.el8_0' ] # Minimum required package levels for RHEL 8.1: __sap_hana_preconfigure_min_packages_8_1_x86_64: - - [ 'kernel' , '4.18.0-147.5.1.el8_1' ] + - [ 'kernel', '4.18.0-147.5.1.el8_1' ] __sap_hana_preconfigure_min_packages_8_1_ppc64le: - - [ 'kernel' , '4.18.0-147.5.1.el8_1' ] + - [ 'kernel', '4.18.0-147.5.1.el8_1' ] __sap_hana_preconfigure_min_packages_8_2_x86_64: - - [ 'kernel' , '4.18.0-193.40.1.el8_2' ] + - [ 'kernel', '4.18.0-193.40.1.el8_2' ] __sap_hana_preconfigure_min_packages_8_2_ppc64le: - - [ 'kernel' , '4.18.0-193.40.1.el8_2' ] + - [ 'kernel', '4.18.0-193.40.1.el8_2' ] __sap_hana_preconfigure_min_packages_8_3_x86_64: __sap_hana_preconfigure_min_packages_8_3_ppc64le: __sap_hana_preconfigure_min_packages_8_4_x86_64: - - [ 'kernel' , '4.18.0-305.3.1.el8_4' ] + - [ 'kernel', '4.18.0-305.3.1.el8_4' ] __sap_hana_preconfigure_min_packages_8_4_ppc64le: - - [ 'kernel' , '4.18.0-305.17.1.el8_4' ] + - [ 'kernel', '4.18.0-305.17.1.el8_4' ] __sap_hana_preconfigure_min_packages_8_5_x86_64: @@ -252,7 +246,7 @@ __sap_hana_preconfigure_packages_min_install: # The packages for RHEL8 are almost the same as for RHEL7. # IBM publishes the packages as a repository here: # https://public.dhe.ibm.com/software/server/POWER/Linux/yum/OSS/RHEL/8/ppc64le/ -# To install the packages, you need to create an appropriate repofile +# To install the packages, you need to create an appropriate repofile # or clone this repository (e.g. with Satellite product) __sap_hana_preconfigure_ibm_power_repo_url: 'http://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-latest.noarch.rpm' @@ -310,11 +304,11 @@ __sap_hana_preconfigure_kernel_parameters_default: # Network related kernel parameters for ppc64le: __sap_hana_preconfigure_kernel_parameters_default_ppc64le: - - { name: net.core.rmem_max, value: 56623104 } - - { name: net.core.wmem_max, value: 56623104 } - - { name: net.ipv4.tcp_rmem, value: "65536 262088 56623104" } - - { name: net.ipv4.tcp_wmem, value: "65536 262088 56623104" } - - { name: net.ipv4.tcp_mem, value: "56623104 56623104 56623104" } + - { name: net.core.rmem_max, value: 56623104 } + - { name: net.core.wmem_max, value: 56623104 } + - { name: net.ipv4.tcp_rmem, value: "65536 262088 56623104" } + - { name: net.ipv4.tcp_wmem, value: "65536 262088 56623104" } + - { name: net.ipv4.tcp_mem, value: "56623104 56623104 56623104" } # Network related kernel parameters for NetApp NFS, as set in SAP Note 3024346: __sap_hana_preconfigure_kernel_parameters_netapp_nfs: @@ -332,9 +326,11 @@ __sap_hana_preconfigure_kernel_parameters_netapp_nfs: # - { name: net.ipv4.tcp_timestamps, value: 1 } - { name: net.ipv4.tcp_sack, value: 1 } +# yamllint disable rule:commas rule:colons __sap_hana_preconfigure_packages_and_services: abrtd: { pkg: 'abrt', svc: 'abrtd', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } abrt-ccpp: { pkg: 'abrt-addon-ccpp', svc: 'abrt-ccpp', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } numad: { pkg: 'numad', svc: 'numad', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } kdump: { pkg: 'kexec-tools', svc: 'kdump', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } firewalld: { pkg: 'firewalld', svc: 'firewalld', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } +# yamllint enable rule:commas rule:colons diff --git a/vars/RedHat_9.yml b/vars/RedHat_9.yml index 591167f..a2b157a 100644 --- a/vars/RedHat_9.yml +++ b/vars/RedHat_9.yml @@ -5,23 +5,17 @@ __sap_hana_preconfigure_supported_rhel_minor_releases: - "9.0" # required repos for RHEL r: -__sap_hana_preconfigure_req_repos_RedHat_9_0_x86_64: +__sap_hana_preconfigure_req_repos_redhat_9_0_x86_64: - "rhel-9-for-x86_64-baseos-e4s-rpms" - "rhel-9-for-x86_64-appstream-e4s-rpms" - "rhel-9-for-x86_64-sap-solutions-e4s-rpms" -__sap_hana_preconfigure_req_repos_RedHat_9_0_ppc64le: +__sap_hana_preconfigure_req_repos_redhat_9_0_ppc64le: - "rhel-9-for-ppc64le-baseos-e4s-rpms" - "rhel-9-for-ppc64le-appstream-e4s-rpms" - "rhel-9-for-ppc64le-sap-solutions-e4s-rpms" # required SAP notes for RHEL 9: -__sap_hana_preconfigure_sapnotes: - - "{% if ansible_architecture == 'ppc64le' %}2055470{% endif %}" - - "2777782" - - "2382421" - - "3024346" - __sap_hana_preconfigure_sapnotes_versions_x86_64: - { number: '2777782', version: '22' } - { number: '2382421', version: '40' } @@ -42,10 +36,10 @@ __sap_hana_preconfigure_sapnotes_versions: "{{ lookup('vars','__sap_hana_preconf # Minimum required package levels for RHEL 9.0: __sap_hana_preconfigure_min_packages_9_0_x86_64: - - [ 'kernel' , '5.11.0-1.el9' ] + - [ 'kernel', '5.11.0-1.el9' ] __sap_hana_preconfigure_min_packages_9_0_ppc64le: - - [ 'kernel' , '5.11.0-2.el9' ] + - [ 'kernel', '5.11.0-2.el9' ] __sap_hana_preconfigure_min_packages_9_1_x86_64: @@ -162,7 +156,7 @@ __sap_hana_preconfigure_packages_min_install: # The packages for RHEL8 are almost the same as for RHEL7. # IBM publishes the packages as a repository here: # https://public.dhe.ibm.com/software/server/POWER/Linux/yum/OSS/RHEL/8/ppc64le/ -# To install the packages, you need to create an appropriate repofile +# To install the packages, you need to create an appropriate repofile # or clone this repository (e.g. with Satellite product) __sap_hana_preconfigure_ibm_power_repo_url: 'http://public.dhe.ibm.com/software/server/POWER/Linux/yum/download/ibm-power-repo-latest.noarch.rpm' @@ -220,11 +214,11 @@ __sap_hana_preconfigure_kernel_parameters_default: # Network related kernel parameters for ppc64le: __sap_hana_preconfigure_kernel_parameters_default_ppc64le: - - { name: net.core.rmem_max, value: 56623104 } - - { name: net.core.wmem_max, value: 56623104 } - - { name: net.ipv4.tcp_rmem, value: "65536 262088 56623104" } - - { name: net.ipv4.tcp_wmem, value: "65536 262088 56623104" } - - { name: net.ipv4.tcp_mem, value: "56623104 56623104 56623104" } + - { name: net.core.rmem_max, value: 56623104 } + - { name: net.core.wmem_max, value: 56623104 } + - { name: net.ipv4.tcp_rmem, value: "65536 262088 56623104" } + - { name: net.ipv4.tcp_wmem, value: "65536 262088 56623104" } + - { name: net.ipv4.tcp_mem, value: "56623104 56623104 56623104" } # Network related kernel parameters for NetApp NFS, as set in SAP Note 3024346: __sap_hana_preconfigure_kernel_parameters_netapp_nfs: @@ -242,9 +236,11 @@ __sap_hana_preconfigure_kernel_parameters_netapp_nfs: # - { name: net.ipv4.tcp_timestamps, value: 1 } - { name: net.ipv4.tcp_sack, value: 1 } +# yamllint disable rule:commas rule:colons __sap_hana_preconfigure_packages_and_services: abrtd: { pkg: 'abrt', svc: 'abrtd', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } abrt-ccpp: { pkg: 'abrt-addon-ccpp', svc: 'abrt-ccpp', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } numad: { pkg: 'numad', svc: 'numad', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } kdump: { pkg: 'kexec-tools', svc: 'kdump', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } firewalld: { pkg: 'firewalld', svc: 'firewalld', systemd_enabled: 'no', systemd_state: 'stopped', svc_status: 'disabled', svc_state: 'inactive' } +# yamllint enable rule:commas rule:colons From 083387e3af7f4eba1b3b9eabeaaf0bf66c97a96b Mon Sep 17 00:00:00 2001 From: Bernd Finger <> Date: Tue, 30 Nov 2021 00:07:59 +0100 Subject: [PATCH 3/4] solve issues #207, #211, and #213 --- .../generic/assert-2055470-loop-block.yml | 2 + .../assert-c-states-for-lower-latency.yml | 3 +- .../assert-cpu-governor-for-performance.yml | 3 +- tasks/RedHat/generic/assert-epb.yml | 3 +- tasks/RedHat/generic/assert-thp.yml | 3 +- tasks/RedHat/generic/assert-tsx.yml | 3 +- ...configure-cpu-governor-for-performance.yml | 3 +- tasks/RedHat/generic/configure-epb.yml | 3 +- tasks/RedHat/generic/configure-tuned.yml | 6 +- tasks/RedHat/installation.yml | 3 +- tasks/sapnote/2009879_7.yml | 39 ++++--- tasks/sapnote/2055470.yml | 110 +++++++++--------- tasks/sapnote/2382421.yml | 45 ++++++- tasks/sapnote/assert-2055470.yml | 77 ++++++------ tasks/sapnote/assert-2382421.yml | 102 +++++++++++++++- tasks/sapnote/assert-3024346.yml | 6 +- 16 files changed, 285 insertions(+), 126 deletions(-) diff --git a/tasks/RedHat/generic/assert-2055470-loop-block.yml b/tasks/RedHat/generic/assert-2055470-loop-block.yml index 51342c2..d99cf67 100644 --- a/tasks/RedHat/generic/assert-2055470-loop-block.yml +++ b/tasks/RedHat/generic/assert-2055470-loop-block.yml @@ -7,6 +7,7 @@ register: __sap_hana_preconfigure_register_sysctl_ibm_largesend_conf_parameter_assert changed_when: no ignore_errors: yes + when: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert.stat.exists - name: 2055470 - Assert that {{ line_item.name }} is set correctly in /etc/sysctl.d/ibm_largesend.conf assert: @@ -16,6 +17,7 @@ success_msg: "PASS: The value of '{{ line_item.name }}' in /etc/sysctl.d/ibm_largesend.conf is '{{ __sap_hana_preconfigure_register_sysctl_ibm_largesend_conf_parameter_assert.stdout }}'." ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" + when: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert.stat.exists - name: 2055470 - Get {{ line_item.name }} from sysctl shell: sysctl -n {{ line_item.name }} | awk '{gsub ("\t", " "); print}' diff --git a/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml b/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml index a62ac0f..998a5e0 100644 --- a/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml +++ b/tasks/RedHat/generic/assert-c-states-for-lower-latency.yml @@ -1,7 +1,8 @@ --- # can be configured by tuned profile sap-hana, entry "force_latency=70" -- block: +- name: Assert - Perform steps for checking the required C-State configuration + block: - name: C-States - Get contents of GRUB_CMDLINE_LINUX in /etc/default/grub command: grep GRUB_CMDLINE_LINUX /etc/default/grub register: __sap_hana_preconfigure_register_default_grub_cmdline_cstate_assert diff --git a/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml b/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml index 72fcbc8..a1b8921 100644 --- a/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml +++ b/tasks/RedHat/generic/assert-cpu-governor-for-performance.yml @@ -2,7 +2,8 @@ # can be configured by tuned profile sap-hana, entry "governor=performance" # in included tuned profile throughput-performance -- block: +- name: Assert - Perform steps for checking the CPU Governor for performance + block: - name: Check if system is able to set CPU Governor for performance (x86_64 platform only) shell: LC_ALL=C cpupower frequency-info -g | awk '/available cpufreq governors/{print $(NF-1), $NF}' check_mode: no diff --git a/tasks/RedHat/generic/assert-epb.yml b/tasks/RedHat/generic/assert-epb.yml index afdfed3..f871a86 100644 --- a/tasks/RedHat/generic/assert-epb.yml +++ b/tasks/RedHat/generic/assert-epb.yml @@ -3,7 +3,8 @@ # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" # 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 -- block: +- name: Assert - Perform steps for checking EPB + block: - name: Check if system supports Intel's performance bias setting (x86_64 platform only) shell: LC_ALL=C cpupower info | head -1 | awk '{print $2, $3, $4}' check_mode: no diff --git a/tasks/RedHat/generic/assert-thp.yml b/tasks/RedHat/generic/assert-thp.yml index 1542494..d736fde 100644 --- a/tasks/RedHat/generic/assert-thp.yml +++ b/tasks/RedHat/generic/assert-thp.yml @@ -1,7 +1,8 @@ --- # can be configured by tuned profile sap-hana, entry "transparent_hugepages=never" -- block: +- name: Perform steps for setting transparent_hugepage=never + block: - name: THP - Get contents of GRUB_CMDLINE_LINUX in /etc/default/grub command: grep GRUB_CMDLINE_LINUX /etc/default/grub register: __sap_hana_preconfigure_register_default_grub_cmdline_thp_assert diff --git a/tasks/RedHat/generic/assert-tsx.yml b/tasks/RedHat/generic/assert-tsx.yml index 6d4ce0f..d24ec2d 100644 --- a/tasks/RedHat/generic/assert-tsx.yml +++ b/tasks/RedHat/generic/assert-tsx.yml @@ -1,6 +1,7 @@ --- -- block: +- name: Assert - Perform steps for checking TSX + block: # There are CPUs which are not capable of enabling the rtm flag, so we just report the status: - name: Get all CPU flags shell: lscpu | grep "^Flags:" diff --git a/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml b/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml index e41294f..c6fd4c0 100644 --- a/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml +++ b/tasks/RedHat/generic/configure-cpu-governor-for-performance.yml @@ -2,7 +2,8 @@ # can be configured by tuned profile sap-hana, entry "governor=performance" # in included tuned profile throughput-performance -- block: +- name: Perform steps for configuring the CPU Governor for performance + block: - name: Check if system is able to set CPU Governor for performance shell: LC_ALL=C cpupower frequency-info -g | awk '/available cpufreq governors/{print $(NF-1), $NF}' check_mode: no diff --git a/tasks/RedHat/generic/configure-epb.yml b/tasks/RedHat/generic/configure-epb.yml index 37541bd..b0a732d 100644 --- a/tasks/RedHat/generic/configure-epb.yml +++ b/tasks/RedHat/generic/configure-epb.yml @@ -3,7 +3,8 @@ # can be configured by tuned profile sap-hana, entry "energy_perf_bias=performance" # 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 -- block: +- name: Perform steps for configuring EPB + block: - name: Check if system supports Intel's performance bias setting shell: set -o pipefail && LC_ALL=C cpupower info | head -1 | awk '{print $2, $3, $4}' check_mode: no diff --git a/tasks/RedHat/generic/configure-tuned.yml b/tasks/RedHat/generic/configure-tuned.yml index f3300a5..29acb9d 100644 --- a/tasks/RedHat/generic/configure-tuned.yml +++ b/tasks/RedHat/generic/configure-tuned.yml @@ -1,6 +1,7 @@ --- -- block: +- name: Perform steps configuring tuned + block: - name: Enable and start tuned service: name: tuned @@ -39,7 +40,8 @@ - sap_hana_preconfigure_use_tuned - (ansible_architecture != "ppc64le" or (ansible_architecture == "ppc64le" and ansible_distribution_version != "8.0")) -- block: +- name: Perform additional steps for RHEL 8.0 ppc64le + block: - name: RHEL 8.0 ppc64le - create directory /etc/tuned/sap-hana-ppc64le file: path: /etc/tuned/sap-hana-ppc64le diff --git a/tasks/RedHat/installation.yml b/tasks/RedHat/installation.yml index cb4bc88..13d1b5f 100644 --- a/tasks/RedHat/installation.yml +++ b/tasks/RedHat/installation.yml @@ -7,7 +7,8 @@ success_msg: "The RHEL release {{ ansible_distribution_version }} is supported for SAP HANA." ignore_errors: "{{ not sap_hana_preconfigure_min_rhel_release_check }}" -- block: +- name: Perform steps for enabling repos for SAP HANA + block: # repos required for SAP HANA on RHEL 7 and RHEL 8: - name: Fill the variable for the generic list of required repos set_fact: diff --git a/tasks/sapnote/2009879_7.yml b/tasks/sapnote/2009879_7.yml index 24918e3..89ad6a7 100644 --- a/tasks/sapnote/2009879_7.yml +++ b/tasks/sapnote/2009879_7.yml @@ -19,26 +19,27 @@ ### 3.8 - Disable Numa Balancing -> SAP Note 2292690 ### 3.9 - Create the compatibility links for HANA -- block: - - name: 3.9 create compatibility links for RHEL 7.2 - file: src=/usr/lib64/{{ line_item.src }} dest=/usr/lib64/{{ line_item.dest }} state=link - with_items: - - { 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' ) - loop_control: - loop_var: line_item +- name: Create compatibility links + block: + - name: 3.9 create compatibility links for RHEL 7.2 + file: src=/usr/lib64/{{ line_item.src }} dest=/usr/lib64/{{ line_item.dest }} state=link + with_items: + - { 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' ) + loop_control: + loop_var: line_item - - name: 3.9 create compatibility links for RHEL 7.3+ - file: src=/usr/lib64/{{ line_item.src }} dest=/usr/lib64/{{ line_item.dest }} state=link - with_items: - - { 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' ) - loop_control: - loop_var: line_item + - name: 3.9 create compatibility links for RHEL 7.3+ + file: src=/usr/lib64/{{ line_item.src }} dest=/usr/lib64/{{ line_item.dest }} state=link + with_items: + - { 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' ) + loop_control: + loop_var: line_item when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2009879_3_9|d(false) diff --git a/tasks/sapnote/2055470.yml b/tasks/sapnote/2055470.yml index 141304a..911e8ce 100644 --- a/tasks/sapnote/2055470.yml +++ b/tasks/sapnote/2055470.yml @@ -13,66 +13,66 @@ - name: Perform configuration changes for ppc64le block: - - name: Configure - Display SAP note number 2055470 and its version - debug: - msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2055470$') | first).number }} - (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2055470$') | first).version }}): SAP HANA on POWER settings" + - name: Configure - Display SAP note number 2055470 and its version + debug: + msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2055470$') | first).number }} + (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2055470$') | first).version }}): SAP HANA on POWER settings" - - name: Ensure MTU size is 9000 on all interfaces - shell: | - mtu=$(nmcli conn show {{ line_item }} | grep 802-3-ethernet.mtu | awk -F: '{printf("%d", $2)}') - if [ "$mtu" != "9000" ]; then - nmcli conn mod {{ line_item }} 802-3-ethernet.mtu "9000" - ip link set mtu 9000 dev {{ line_item }} - else - exit 90 - fi - register: __sap_hana_preconfigure_register_ibm_mtusize - changed_when: __sap_hana_preconfigure_register_ibm_mtusize is success - failed_when: __sap_hana_preconfigure_register_ibm_mtusize.rc > 0 and __sap_hana_preconfigure_register_ibm_mtusize.rc != 90 - with_items: "{{ sap_hana_preconfigure_ppcle_mtu9000_if }}" - when: not( - (sap_hana_preconfigure_ppcle_mtu9000_if is undefined) or - (sap_hana_preconfigure_ppcle_mtu9000_if is none) or - (sap_hana_preconfigure_ppcle_mtu9000_if | trim | length == 0) - ) - loop_control: - loop_var: line_item + - name: Ensure MTU size is 9000 on all interfaces + shell: | + mtu=$(nmcli conn show {{ line_item }} | grep 802-3-ethernet.mtu | awk -F: '{printf("%d", $2)}') + if [ "$mtu" != "9000" ]; then + nmcli conn mod {{ line_item }} 802-3-ethernet.mtu "9000" + ip link set mtu 9000 dev {{ line_item }} + else + exit 90 + fi + register: __sap_hana_preconfigure_register_ibm_mtusize + changed_when: __sap_hana_preconfigure_register_ibm_mtusize is success + failed_when: __sap_hana_preconfigure_register_ibm_mtusize.rc > 0 and __sap_hana_preconfigure_register_ibm_mtusize.rc != 90 + with_items: "{{ sap_hana_preconfigure_ppcle_mtu9000_if }}" + when: not( + (sap_hana_preconfigure_ppcle_mtu9000_if is undefined) or + (sap_hana_preconfigure_ppcle_mtu9000_if is none) or + (sap_hana_preconfigure_ppcle_mtu9000_if | trim | length == 0) + ) + loop_control: + loop_var: line_item # This only works if interfacename=device name, otherwise it fails - - name: Add largesend options to interfaces - lineinfile: - path: /etc/sysconfig/network-scripts/ifcfg-{{ line_item }} - regexp: '^ETHTOOL_OPTIONS_tso=' - line: ETHTOOL_OPTIONS_tso='-K iface tso on' - with_items: "{{ sap_hana_preconfigure_ppcle_tso_if }}" - when: not( - (sap_hana_preconfigure_ppcle_tso_if is undefined) or - (sap_hana_preconfigure_ppcle_tso_if is none) or - (sap_hana_preconfigure_ppcle_tso_if | trim | length == 0) - ) - loop_control: - loop_var: line_item - ignore_errors: true + - name: Add largesend options to interfaces + lineinfile: + path: /etc/sysconfig/network-scripts/ifcfg-{{ line_item }} + regexp: '^ETHTOOL_OPTIONS_tso=' + line: ETHTOOL_OPTIONS_tso='-K iface tso on' + with_items: "{{ sap_hana_preconfigure_ppcle_tso_if }}" + when: not( + (sap_hana_preconfigure_ppcle_tso_if is undefined) or + (sap_hana_preconfigure_ppcle_tso_if is none) or + (sap_hana_preconfigure_ppcle_tso_if | trim | length == 0) + ) + loop_control: + loop_var: line_item + ignore_errors: true - - name: Add largesend kernel parameters for ppc64le - lineinfile: - path: /etc/sysctl.d/ibm_largesend.conf - create: yes - mode: 0644 - regexp: ^{{ line_item.name }}.* - line: "{{ line_item.name }}={{ line_item.value }}" - state: present - with_items: "{{ sap_hana_preconfigure_kernel_parameters_ppc64le }}" - loop_control: - loop_var: line_item + - name: Add largesend kernel parameters for ppc64le + lineinfile: + path: /etc/sysctl.d/ibm_largesend.conf + create: yes + mode: 0644 + regexp: ^{{ line_item.name }}.* + line: "{{ line_item.name }}={{ line_item.value }}" + state: present + with_items: "{{ sap_hana_preconfigure_kernel_parameters_ppc64le }}" + loop_control: + loop_var: line_item - - name: Reload kernel parameters from file '/etc/sysctl.d/ibm_largesend.conf' - command: sysctl -p /etc/sysctl.d/ibm_largesend.conf - register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output + - name: Reload kernel parameters from file '/etc/sysctl.d/ibm_largesend.conf' + command: sysctl -p /etc/sysctl.d/ibm_largesend.conf + register: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output - - name: Print largesend kernel parameters - debug: - var: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output.stdout_lines + - name: Display largesend kernel parameters + debug: + var: __sap_hana_preconfigure_register_ibm_largesend_sysctl_p_output.stdout_lines when: ansible_architecture == 'ppc64le' diff --git a/tasks/sapnote/2382421.yml b/tasks/sapnote/2382421.yml index 3c05152..0db8213 100644 --- a/tasks/sapnote/2382421.yml +++ b/tasks/sapnote/2382421.yml @@ -21,11 +21,54 @@ loop_control: loop_var: line_item + - name: Set net.core.wmem_max and net.core.rmem_max if necessary + block: + + - name: Get the value of net.ipv4.tcp_wmem + command: sysctl net.ipv4.tcp_wmem + check_mode: no + register: __sap_hana_preconfigure_register_sysctl_ipv4_tcp_wmem + + - name: Display the maximum value of net.ipv4.tcp_wmem + debug: + var: __sap_hana_preconfigure_register_sysctl_ipv4_tcp_wmem.stdout.split()[-1] + + - name: Get the value of net.ipv4.tcp_rmem + command: sysctl net.ipv4.tcp_rmem + check_mode: no + register: __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem + + - name: Display the maximum value of net.ipv4.tcp_rmem + debug: + var: __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem.stdout.split()[-1] + + - name: Set net.core.wmem_max to the maximum value of net.ipv4.tcp_wmem if necessary + lineinfile: + path: "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" + create: yes + mode: 0644 + regexp: ^net.core.wmem_max.* + line: "net.core.wmem_max={{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_wmem.stdout.split()[-1] }}" + state: present + + - name: Set net.core.rmem_max to the maximum value of net.ipv4.tcp_rmem if necessary + lineinfile: + path: "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" + create: yes + mode: 0644 + regexp: ^net.core.rmem_max.* + line: "net.core.rmem_max={{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem.stdout.split()[-1] }}" + state: present + + when: + - not sap_hana_preconfigure_use_netapp_settings_nfs|d(false) + - not ansible_architecture == 'ppc64le' + - name: Reload kernel parameters from file '{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}' command: sysctl -p "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" register: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output - - name: Print kernel parameters for network tuning + - name: Display kernel parameters for network tuning debug: var: __sap_hana_preconfigure_register_saphana_conf_sysctl_p_output.stdout_lines diff --git a/tasks/sapnote/assert-2055470.yml b/tasks/sapnote/assert-2055470.yml index a39d4ac..6ef2168 100644 --- a/tasks/sapnote/assert-2055470.yml +++ b/tasks/sapnote/assert-2055470.yml @@ -10,15 +10,17 @@ # http://www-03.ibm.com/support/techdocs/atsmastr.nsf/5cb5ed706d254a8186256c71006d2e0a/c32b40501f4f76c886257de0004fa1d4/$FILE/ # Network_Configuration_for_HANA_Workloads_on_IBM_Power_Servers_V4.pdf -- block: - - name: Assert - Display SAP note number 2055470 and its version - debug: - msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2055470$') | first).number }} - (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2055470$') | first).version }}): SAP HANA on POWER settings" +- name: Assert ppc64le specific settings + block: - - name: Display an info about checking the MTU size - debug: - msg: "WARN: Checking of MTU size==9000 on all interfaces not yet implemented. Please check manually!" + - name: Assert - Display SAP note number 2055470 and its version + debug: + msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2055470$') | first).number }} + (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2055470$') | first).version }}): SAP HANA on POWER settings" + + - name: Display an info about checking the MTU size + debug: + msg: "WARN: Checking of MTU size==9000 on all interfaces not yet implemented. Please check manually!" #- name: ensure MTU size is 9000 on all interfaces # shell: | @@ -41,9 +43,9 @@ # loop_var: line_item # This only works if interfacename=device name, otherwise it fails - - name: Display an info about checking largesend options - debug: - msg: "WARN: Checking of largesend options of interface {{ sap_hana_preconfigure_ppcle_tso_if }} not yet implemented. Please check manually!" + - name: Display an info about checking largesend options + debug: + msg: "WARN: Checking of largesend options of interface {{ sap_hana_preconfigure_ppcle_tso_if }} not yet implemented. Please check manually!" #- name: add largesend options to interface # lineinfile: @@ -55,36 +57,35 @@ # loop_control: # loop_var: line_item - - block: - - name: Get info about file /etc/sysctl.d/ibm_largesend.conf - stat: - path: /etc/sysctl.d/ibm_largesend.conf - register: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert + - name: Check /etc/sysctl.d/ibm_largesend.conf + block: + - name: Get info about file /etc/sysctl.d/ibm_largesend.conf + stat: + path: /etc/sysctl.d/ibm_largesend.conf + register: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert - - name: Assert that file /etc/sysctl.d/ibm_largesend.conf exists - assert: - that: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert.stat.exists - fail_msg: "FAIL: File /etc/sysctl.d/ibm_largesend.conf does not exist!" - success_msg: "PASS: File /etc/sysctl.d/ibm_largesend.conf exists." - ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" + - name: Assert that file /etc/sysctl.d/ibm_largesend.conf exists + assert: + that: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert.stat.exists + fail_msg: "FAIL: File /etc/sysctl.d/ibm_largesend.conf does not exist!" + success_msg: "PASS: File /etc/sysctl.d/ibm_largesend.conf exists." + ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - - name: Assert that file /etc/sysctl.d/ibm_largesend.conf is a regular file - assert: - that: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert.stat.isreg - fail_msg: "FAIL: File /etc/sysctl.d/ibm_largesend.conf is not a regular file!" - success_msg: "PASS: File /etc/sysctl.d/ibm_largesend.conf is a regular file." - ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" - when: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert.stat.exists + - name: Assert that file /etc/sysctl.d/ibm_largesend.conf is a regular file + assert: + that: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert.stat.isreg + fail_msg: "FAIL: File /etc/sysctl.d/ibm_largesend.conf is not a regular file!" + success_msg: "PASS: File /etc/sysctl.d/ibm_largesend.conf is a regular file." + ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" + when: __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert.stat.exists - when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2055470|d(false) + when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2055470|d(false) - - name: Get and assert kernel tunables for ppc64le - include_tasks: ../RedHat/generic/assert-2055470-loop-block.yml - loop: "{{ sap_hana_preconfigure_kernel_parameters_ppc64le }}" - loop_control: - loop_var: line_item - when: - - __sap_hana_preconfigure_register_stat_sysctl_ibm_largesend_conf_assert.stat.exists - - sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2055470|d(false) + - name: Get and assert kernel tunables for ppc64le + include_tasks: ../RedHat/generic/assert-2055470-loop-block.yml + loop: "{{ sap_hana_preconfigure_kernel_parameters_ppc64le }}" + loop_control: + loop_var: line_item + when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2055470|d(false) when: ansible_architecture == 'ppc64le' diff --git a/tasks/sapnote/assert-2382421.yml b/tasks/sapnote/assert-2382421.yml index cd593a7..a60ed73 100644 --- a/tasks/sapnote/assert-2382421.yml +++ b/tasks/sapnote/assert-2382421.yml @@ -8,7 +8,8 @@ msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2382421$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^2382421$') | first).version }}): Recommended network settings for SAP HANA" -- block: +- name: Check SAP HANA sysctl conf file + block: - name: Get info about file {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} stat: path: "{{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }}" @@ -37,3 +38,102 @@ loop_control: loop_var: line_item when: sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_2382421|d(false) + +- name: Check net.core.wmem_max and net.core.rmem_max if necessary + block: + - name: 2382421 - Get the maximum value of net.ipv4.tcp_wmem + command: sysctl net.ipv4.tcp_wmem + register: __sap_hana_preconfigure_register_sysctl_ipv4_tcp_wmem_assert + changed_when: no + ignore_errors: yes + + - name: Display the maximum value of net.ipv4.tcp_wmem + debug: + msg: "INFO: The maximum value of net.ipv4.tcp_wmem is '{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_wmem_assert.stdout.split()[-1] }}'" + + - name: 2382421 - Get net.core.wmem_max from {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} + command: awk 'BEGIN{FS="="}/net.core.wmem_max/{print $NF}' {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} + register: __sap_hana_preconfigure_register_sysctl_saphana_conf_wmem_max_assert + changed_when: no + ignore_errors: yes + when: __sap_hana_preconfigure_register_stat_sysctl_saphana_conf_assert.stat.exists + + - name: 2382421 - Assert that net.core.wmem_max is set correctly in {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} + assert: + that: "__sap_hana_preconfigure_register_sysctl_saphana_conf_wmem_max_assert.stdout == + '{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_wmem_assert.stdout.split()[-1] }}'" + fail_msg: "FAIL: The value of 'net.core.wmem_max' in {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} is + '{{ __sap_hana_preconfigure_register_sysctl_saphana_conf_wmem_max_assert.stdout }}' but the expected value is + '{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_wmem_assert.stdout.split()[-1] }}'!" + success_msg: "PASS: The value of 'net.core.wmem_max' in {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} is + '{{ __sap_hana_preconfigure_register_sysctl_saphana_conf_wmem_max_assert.stdout }}'." + ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" + when: __sap_hana_preconfigure_register_stat_sysctl_saphana_conf_assert.stat.exists + + - name: 2382421 - Get the current value of net.core.wmem_max from sysctl + command: sysctl net.core.wmem_max + register: __sap_hana_preconfigure_register_sysctl_ipv4_tcp_wmem_max_assert + changed_when: no + ignore_errors: yes + + - name: 2382421 - Assert that net.core.wmem_max is set correctly as per sysctl + assert: + that: "'{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_wmem_max_assert.stdout.split()[-1] }}' == + '{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_wmem_assert.stdout.split()[-1] }}'" + fail_msg: "FAIL: The current value of 'net.core.wmem_max as per sysctl is + '{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_wmem_max_assert.stdout.split()[-1] }}' but the expected value is + '{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_wmem_assert.stdout.split()[-1] }}'!" + success_msg: "PASS: The current value of 'net.core.wmem_max' as per sysctl is + '{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_wmem_assert.stdout.split()[-1] }}'." + ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" + + - name: 2382421 - Get the maximum value of net.ipv4.tcp_rmem + command: sysctl net.ipv4.tcp_rmem + register: __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem_assert + changed_when: no + ignore_errors: yes + + - name: 2382421 - Display the maximum value of net.ipv4.tcp_rmem + debug: + msg: "INFO: The maximum value of net.ipv4.tcp_rmem is '{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem_assert.stdout.split()[-1] }}'" + + - name: 2382421 - Get net.core.rmem_max from {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} + command: awk 'BEGIN{FS="="}/net.core.rmem_max/{print $NF}' {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} + register: __sap_hana_preconfigure_register_sysctl_saphana_conf_rmem_max_assert + changed_when: no + ignore_errors: yes + when: __sap_hana_preconfigure_register_stat_sysctl_saphana_conf_assert.stat.exists + + - name: 2382421 - Assert that net.core.rmem_max is set correctly in {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} + assert: + that: "__sap_hana_preconfigure_register_sysctl_saphana_conf_rmem_max_assert.stdout == + '{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem_assert.stdout.split()[-1] }}'" + fail_msg: "FAIL: The value of 'net.core.rmem_max' in {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} is + '{{ __sap_hana_preconfigure_register_sysctl_saphana_conf_rmem_max_assert.stdout }}' but the expected value is + '{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem_assert.stdout.split()[-1] }}'!" + success_msg: "PASS: The value of 'net.core.rmem_max' in {{ __sap_hana_preconfigure_etc_sysctl_saphana_conf }} is + '{{ __sap_hana_preconfigure_register_sysctl_saphana_conf_rmem_max_assert.stdout }}'." + ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" + when: __sap_hana_preconfigure_register_stat_sysctl_saphana_conf_assert.stat.exists + + - name: 2382421 - Get the current value of net.core.rmem_max from sysctl + command: sysctl net.core.rmem_max + register: __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem_max_assert + changed_when: no + ignore_errors: yes + + - name: 2382421 - Assert that net.core.rmem_max is set correctly as per sysctl + assert: + that: "'{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem_max_assert.stdout.split()[-1] }}' == + '{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem_assert.stdout.split()[-1] }}'" + fail_msg: "FAIL: The current value of 'net.core.rmem_max as per sysctl is + '{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem_max_assert.stdout.split()[-1] }}' but the expected value is + '{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem_assert.stdout.split()[-1] }}'!" + success_msg: "PASS: The current value of 'net.core.rmem_max' as per sysctl is + '{{ __sap_hana_preconfigure_register_sysctl_ipv4_tcp_rmem_assert.stdout.split()[-1] }}'." + ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors|d(false) }}" + + 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' diff --git a/tasks/sapnote/assert-3024346.yml b/tasks/sapnote/assert-3024346.yml index 0b82433..545bd2a 100644 --- a/tasks/sapnote/assert-3024346.yml +++ b/tasks/sapnote/assert-3024346.yml @@ -7,7 +7,8 @@ msg: "SAP note {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^3024346$') | first).number }} (version {{ (__sap_hana_preconfigure_sapnotes_versions | selectattr('number', 'match', '^3024346$') | first).version }}): Linux kernel settings for NetApp NFS" -- block: +- name: Check NetApp sysctl conf file for SAP HANA + block: - name: Get info about file {{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }} stat: path: "{{ __sap_hana_preconfigure_etc_sysctl_netapp_hana_conf }}" @@ -41,7 +42,8 @@ - sap_hana_preconfigure_use_netapp_settings_nfs|d(false) - sap_hana_preconfigure_config_all|d(true) or sap_hana_preconfigure_3024346|d(false) -- block: +- name: Check NetApp modprobe conf file for SAP HANA with NFSv3 + block: - name: Get info about file /etc/modprobe.d/sunrpc.conf stat: path: /etc/modprobe.d/sunrpc.conf From 5be04d3a1b3f64b1966075896d9f7428fbf70a0b Mon Sep 17 00:00:00 2001 From: Bernd Finger <> Date: Thu, 2 Dec 2021 23:21:17 +0100 Subject: [PATCH 4/4] add GitHub ansible-lint action --- .github/workflows/ansible-lint.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/ansible-lint.yml diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml new file mode 100644 index 0000000..bcfb244 --- /dev/null +++ b/.github/workflows/ansible-lint.yml @@ -0,0 +1,20 @@ +name: Ansible Lint + +on: [push, pull_request] + +jobs: + ansible-lint: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Lint Ansible Playbook + uses: ansible/ansible-lint-action@master + with: + targets: | + ./ + override-deps: | + ansible-core==2.12 + ansible-lint==5.3.0