From 180be5c42561c4375ddf4894916d39f900ee641c Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Wed, 20 Dec 2023 21:58:10 +0100 Subject: [PATCH 1/3] sap_netweaver_preconfigure: Add support for Ansible 2.16.1 Signed-off-by: Bernd Finger --- .../tasks/RedHat/assert-configuration.yml | 2 +- .../tasks/RedHat/assert-installation.yml | 3 +-- .../tasks/SLES/assert-installation.yml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-configuration.yml b/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-configuration.yml index 60d2e5ad5..496f5c88d 100644 --- a/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-configuration.yml +++ b/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-configuration.yml @@ -21,7 +21,7 @@ - name: Assert that enough swap space is configured ansible.builtin.assert: that: - - "ansible_swaptotal_mb >= {{ sap_netweaver_preconfigure_min_swap_space_mb }}" + - (ansible_swaptotal_mb | int) >= (sap_netweaver_preconfigure_min_swap_space_mb | int) fail_msg: "FAIL: The system has only {{ ansible_swaptotal_mb }} MB of swap space configured, which is less than the minimum required amount of {{ sap_netweaver_preconfigure_min_swap_space_mb }} MB for SAP NetWeaver!" success_msg: "PASS: The system has {{ ansible_swaptotal_mb }} MB of swap space configured, diff --git a/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml b/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml index f8767c3c7..14fd4eb25 100644 --- a/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml +++ b/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml @@ -2,8 +2,7 @@ - name: Assert that all required packages are installed ansible.builtin.assert: - that: - - "'{{ line_item }}' in ansible_facts.packages" + that: line_item in ansible_facts.packages fail_msg: "FAIL: Package '{{ line_item }}' is not installed!" success_msg: "PASS: Package '{{ line_item }}' is installed." with_items: diff --git a/roles/sap_netweaver_preconfigure/tasks/SLES/assert-installation.yml b/roles/sap_netweaver_preconfigure/tasks/SLES/assert-installation.yml index ed69f0de8..b4e51604f 100644 --- a/roles/sap_netweaver_preconfigure/tasks/SLES/assert-installation.yml +++ b/roles/sap_netweaver_preconfigure/tasks/SLES/assert-installation.yml @@ -7,7 +7,7 @@ - name: Ensure required packages for SAP NetWeaver are installed ansible.builtin.assert: - that: "'{{ package }}' in ansible_facts.packages" + that: package in ansible_facts.packages loop: "{{ __sap_netweaver_preconfigure_packages }}" loop_control: loop_var: package From 58cc7a19d65d4d22388d549518bda276724f65c4 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 21 Dec 2023 12:10:56 +0100 Subject: [PATCH 2/3] sap_netweaver_preconfigure: remove more double quotes, replace rc==0 by success Signed-off-by: Bernd Finger --- .../tasks/SLES/assert-configuration.yml | 2 +- .../sap_netweaver_preconfigure/tasks/sapnote/assert-2526952.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml b/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml index 3360e8232..ed1f80f7a 100644 --- a/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml +++ b/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml @@ -18,7 +18,7 @@ - name: Assert that saptune_check executed correctly ansible.builtin.assert: - that: "__sap_netweaver_preconfigure_register_saptune_check.rc == 0" + that: __sap_netweaver_preconfigure_register_saptune_check is success fail_msg: "FAIL: the command saptune_check fails" success_msg: "PASS: the command saptune_check executes as expected" diff --git a/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-2526952.yml b/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-2526952.yml index fd73c4df0..1cada2e82 100644 --- a/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-2526952.yml +++ b/roles/sap_netweaver_preconfigure/tasks/sapnote/assert-2526952.yml @@ -51,7 +51,7 @@ - name: Assert that tuned profile sap-netweaver is currently active ansible.builtin.assert: - that: "__sap_netweaver_preconfigure_register_current_tuned_profile.stdout == 'sap-netweaver'" + that: __sap_netweaver_preconfigure_register_current_tuned_profile.stdout == 'sap-netweaver' fail_msg: "FAIL: The tuned profile 'sap-netweaver' is currently not active! Currently active profile: '{{ __sap_netweaver_preconfigure_register_current_tuned_profile.stdout }}'." success_msg: "PASS: The tuned profile 'sap-netweaver' is currently active." From a488972bd060c454eb47f6e35d93a25c02a485b1 Mon Sep 17 00:00:00 2001 From: Bernd Finger Date: Thu, 21 Dec 2023 15:56:12 +0100 Subject: [PATCH 3/3] sap_netweaver_preconfigure: revert "is success" to "rc==0" Signed-off-by: Bernd Finger --- .../tasks/SLES/assert-configuration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml b/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml index ed1f80f7a..3360e8232 100644 --- a/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml +++ b/roles/sap_netweaver_preconfigure/tasks/SLES/assert-configuration.yml @@ -18,7 +18,7 @@ - name: Assert that saptune_check executed correctly ansible.builtin.assert: - that: __sap_netweaver_preconfigure_register_saptune_check is success + that: "__sap_netweaver_preconfigure_register_saptune_check.rc == 0" fail_msg: "FAIL: the command saptune_check fails" success_msg: "PASS: the command saptune_check executes as expected"