Resolves: #2143280, drop deprecated paramater for Ansible 2.14

This commit is contained in:
Than Ngo 2022-11-27 16:23:12 +01:00
parent 17aa362e28
commit dfd08a4a1d
3 changed files with 262 additions and 2 deletions

View File

@ -0,0 +1,33 @@
commit 3c225d526663084ca7ca6060fae6cb64d2834307
Author: Bernd Finger <bfinger@redhat.com>
Date: Thu Nov 17 14:01:26 2022 +0100
preconfigure roles: Solve ansible-lint errors for issue #246
diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml b/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml
index 64eb3f7..3d2f6d8 100644
--- a/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml
+++ b/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml
@@ -167,7 +167,8 @@
msg: "INFO: No minimum required package version defined (variable __sap_hana_preconfigure_min_pkgs)."
when: not __sap_hana_preconfigure_min_pkgs | d([])
-- name: Get info about possible package updates
+# Reason for noqa: The yum module appears to not support the check-update option
+- name: Get info about possible package updates # noqa command-instead-of-module
ansible.builtin.command: yum check-update
register: __sap_hana_preconfigure_register_yum_check_update_assert
changed_when: false
diff -up community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml.me community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml
--- community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml.me 2022-11-22 16:03:52.385722586 +0100
+++ community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml 2022-11-22 16:06:49.465856762 +0100
@@ -7,7 +7,8 @@
- name: Check of package pseries-energy
block:
- - name: Check if package pseries-energy is not installed
+ # Reason for noqa: In assert mode, we do not enforce a certain configuration.
+ - name: Check if package pseries-energy is not installed # noqa command-instead-of-module
ansible.builtin.command: yum info installed pseries-energy
register: __sap_hana_preconfigure_register_yum_pseries_energy_assert
changed_when: no

View File

@ -0,0 +1,220 @@
commit d52feb6262501f0723b67fc06c38ca0019d6d31d
Author: Bernd Finger <bfinger@redhat.com>
Date: Thu Nov 17 13:27:00 2022 +0100
preconfigure roles: Solve issue #246
diff --git a/roles/sap_general_preconfigure/handlers/main.yml b/roles/sap_general_preconfigure/handlers/main.yml
index 47ad190..8d43fdf 100644
--- a/roles/sap_general_preconfigure/handlers/main.yml
+++ b/roles/sap_general_preconfigure/handlers/main.yml
@@ -26,8 +26,6 @@
- name: Remount /dev/shm
ansible.builtin.command: mount -o remount /dev/shm
- args:
- warn: false
listen: __sap_general_preconfigure_mount_tmpfs_handler
- name: Check if /dev/shm is available
diff --git a/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml b/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml
index da8233f..9f0e8cf 100644
--- a/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml
+++ b/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml
@@ -229,9 +229,8 @@
- name: Get info about possible package updates
ansible.builtin.command: yum check-update
register: __sap_general_preconfigure_register_yum_check_update_assert
- args:
- warn: false
changed_when: false
+ no_log: true
ignore_errors: "{{ sap_general_preconfigure_assert_ignore_errors | d(false) }}"
when: sap_general_preconfigure_update
@@ -278,8 +277,6 @@
ansible.builtin.shell: "{{ __sap_general_preconfigure_fact_needs_restarting_command_assert }}"
register: __sap_general_preconfigure_register_needs_restarting_assert
changed_when: false
- args:
- warn: false
check_mode: false
ignore_errors: "{{ sap_general_preconfigure_assert_ignore_errors | d(false) }}"
diff --git a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml
index 1600940..8471acf 100644
--- a/roles/sap_general_preconfigure/tasks/RedHat/installation.yml
+++ b/roles/sap_general_preconfigure/tasks/RedHat/installation.yml
@@ -78,8 +78,6 @@
- name: Get list of enabled repositories
ansible.builtin.command: "yum repolist" # noqa command-instead-of-module
register: __sap_general_preconfigure_register_yum_repolist
- args:
- warn: false
changed_when: false
- name: Display the list of enabled repositories
diff --git a/roles/sap_general_preconfigure/tasks/SLES/assert-installation.yml b/roles/sap_general_preconfigure/tasks/SLES/assert-installation.yml
index 647c5df..53f4446 100644
--- a/roles/sap_general_preconfigure/tasks/SLES/assert-installation.yml
+++ b/roles/sap_general_preconfigure/tasks/SLES/assert-installation.yml
@@ -81,8 +81,6 @@
- name: Get info about possible package updates
ansible.builtin.command: yum check-update
register: __sap_general_preconfigure_register_yum_check_update_assert
- args:
- warn: false
changed_when: false
ignore_errors: "{{ sap_general_preconfigure_assert_ignore_errors | d(false) }}"
when: sap_general_preconfigure_update
diff --git a/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml b/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml
index 8d72936..64eb3f7 100644
--- a/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml
+++ b/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml
@@ -170,9 +170,8 @@
- name: Get info about possible package updates
ansible.builtin.command: yum check-update
register: __sap_hana_preconfigure_register_yum_check_update_assert
- args:
- warn: false
changed_when: false
+ no_log: true
ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}"
when: sap_hana_preconfigure_update
diff --git a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml
index e84302a..8b2133f 100644
--- a/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml
+++ b/roles/sap_hana_preconfigure/tasks/sapnote/2292690/10-assert-ibm-energyscale.yml
@@ -14,8 +14,6 @@
register: __sap_hana_preconfigure_register_yum_pseries_energy_assert
changed_when: no
ignore_errors: yes
- args:
- warn: false
- name: Assert that package pseries-energy is not installed
ansible.builtin.assert:
diff -up community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml.me community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml
--- community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml.me 2022-11-24 16:09:30.351779764 +0100
+++ community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_general_preconfigure/tasks/RedHat/assert-installation.yml 2022-11-24 16:09:51.607092047 +0100
@@ -103,8 +103,6 @@
ansible.builtin.shell: "{{ __sap_general_preconfigure_fact_yum_group_list_installed_command_assert }}"
register: __sap_general_preconfigure_register_yum_group_assert
changed_when: no
- args:
- warn: false
- name: Assert that all required RHEL 7 package groups are installed
ansible.builtin.assert:
@@ -134,8 +132,6 @@
ansible.builtin.shell: "{{ __sap_general_preconfigure_fact_yum_envgroup_list_installed_command_assert }}"
register: __sap_general_preconfigure_register_yum_envgroup_assert
changed_when: no
- args:
- warn: false
- name: Assert that all required RHEL 8 environment groups are installed
ansible.builtin.assert:
diff -up community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_general_preconfigure/tasks/RedHat/installation.yml.me community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_general_preconfigure/tasks/RedHat/installation.yml
--- community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_general_preconfigure/tasks/RedHat/installation.yml.me 2022-11-24 15:39:24.083358360 +0100
+++ community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_general_preconfigure/tasks/RedHat/installation.yml 2022-11-24 16:09:16.734569938 +0100
@@ -104,10 +104,9 @@
- sap_general_preconfigure_set_minor_release
- __sap_general_preconfigure_register_subscription_manager_release.stdout != ansible_distribution_version
-- name: Ensure that the required package groups are installed, RHEL 7
+# Reason for noqa: The yum module appears to not support the check-update option
+- name: Ensure that the required package groups are installed, RHEL 7 # noqa command-instead-of-module
ansible.builtin.command: "yum install {{ sap_general_preconfigure_packagegroups|join(' ') }} -y"
- args:
- warn: false
register: __sap_general_preconfigure_register_yum_group_install
when: ansible_distribution_major_version == '7'
@@ -116,11 +115,11 @@
var: __sap_general_preconfigure_register_yum_group_install
when: ansible_distribution_major_version == '7'
-- name: Ensure that the required package groups are installed, RHEL 8 and RHEL 9
+# Reason for noqa: The yum module appears to not support the check-update option
+- name: Ensure that the required package groups are installed, RHEL 8 and RHEL 9 # noqa command-instead-of-module
# Note: We want to avoid unwanted package upgrades, see bug 1983749.
+
ansible.builtin.command: "yum install {{ sap_general_preconfigure_packagegroups|join(' ') }} --nobest --exclude=kernel* -y"
- args:
- warn: false
register: __sap_general_preconfigure_register_yum_group_install
when: ansible_distribution_major_version == '8' or ansible_distribution_major_version == '9'
@@ -229,8 +228,6 @@
register: __sap_general_preconfigure_register_needs_restarting
ignore_errors: true
changed_when: false
- args:
- warn: false
check_mode: false
- name: Display the output of the reboot requirement check
diff -up community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml.me community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml
--- community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml.me 2022-11-24 16:29:58.053514750 +0100
+++ community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_hana_preconfigure/tasks/RedHat/assert-installation.yml 2022-11-24 16:30:25.886020641 +0100
@@ -85,8 +85,6 @@
ansible.builtin.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:
- warn: false
- name: Assert that all required IBM packages are installed
ansible.builtin.assert:
@@ -223,8 +221,6 @@
ansible.builtin.shell: "{{ __sap_hana_preconfigure_fact_needs_restarting_command_assert }}"
register: __sap_hana_preconfigure_register_needs_restarting_assert
changed_when: false
- args:
- warn: false
check_mode: false
ignore_errors: "{{ sap_hana_preconfigure_assert_ignore_errors | d(false) }}"
diff -up community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml.me community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml
--- community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml.me 2022-11-24 16:29:34.036071972 +0100
+++ community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_hana_preconfigure/tasks/RedHat/installation.yml 2022-11-24 16:29:47.668325538 +0100
@@ -205,8 +205,6 @@
register: __sap_hana_preconfigure_register_needs_restarting
ignore_errors: true
changed_when: false
- args:
- warn: false
check_mode: false
- name: Display the output of the reboot requirement check
diff -up community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_ha_prepare_pacemaker/tasks/software_setup.yml.me community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_ha_prepare_pacemaker/tasks/software_setup.yml
--- community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_ha_prepare_pacemaker/tasks/software_setup.yml.me 2022-11-24 16:11:35.901018559 +0100
+++ community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_ha_prepare_pacemaker/tasks/software_setup.yml 2022-11-24 16:29:19.834807820 +0100
@@ -4,7 +4,6 @@
yum repolist
args:
executable: /bin/bash
- warn: no
become: true
become_user: root
register: sap_ha_prepare_pacemaker_check_ha_repos
diff -up community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml.me community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml
--- community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml.me 2022-11-24 16:10:14.505495496 +0100
+++ community.sap_install-a2c6785d02092bb9142d9f2c170ad4b097d1af2f/roles/sap_netweaver_preconfigure/tasks/RedHat/assert-installation.yml 2022-11-24 16:10:52.338204907 +0100
@@ -12,12 +12,11 @@
loop_var: line_item
ignore_errors: "{{ sap_netweaver_preconfigure_assert_ignore_errors | d(false) }}"
-- name: Check if required packages for Adobe Document Services are installed
+# Reason for noqa: The yum module appears to not support the check-update option
+- name: Check if required packages for Adobe Document Services are installed # noqa command-instead-of-module
ansible.builtin.shell: rpm -q --qf "%{NAME}.%{ARCH}\n" {{ __sap_netweaver_preconfigure_adobe_doc_services_packages | map('quote') | join(' ') }}
register: __sap_netweaver_preconfigure_register_rpm_q_ads_packages
changed_when: no
- args:
- warn: false
when: sap_netweaver_preconfigure_use_adobe_doc_services | d(false)
ignore_errors: "{{ sap_netweaver_preconfigure_assert_ignore_errors | d(false) }}"

View File

@ -56,7 +56,7 @@
Name: %{package_name}
Summary: System Roles to configure RHEL for running SAP NetWeaver- or SAP HANA-based products
Version: 3.3.0
Release: 3%{?dist}
Release: 4%{?dist}
License: GPLv3+
Url: https://github.com/berndfinger/community.sap_install
Source0: https://github.com/linux-system-roles/auto-maintenance/archive/%{mainid}/auto-maintenance-%{mainid}.tar.gz
@ -65,6 +65,8 @@ Source4: https://gitlab.cee.redhat.com/bfinger/build-redhat.sap_install/-/raw/ma
Source5: https://gitlab.cee.redhat.com/bfinger/build-redhat.sap_install/-/raw/main/galaxy.yml
Patch1: community.sap_install-shebang.patch
Patch2: sap-hana-preconfigure-md2html-error.patch
Patch3: community.sap_install-warn-no-longer-supported.patch
Patch4: community.sap_install-ansible-lint-errors.patch
BuildArch: noarch
@ -140,6 +142,8 @@ sed -i -e "s|^version: .*|version: %{collection_version}|" galaxy.yml
pushd %{github_repo_sap_install}-%{commit_id_sap_install}/
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
popd
# remove zero file and symlinks
@ -147,7 +151,7 @@ find . -type f -size 0 -delete
find . -type l -delete
pushd %{github_repo_sap_install}-%{commit_id_sap_install}/roles/
# remove all SLES stuff and RHEL 5 stuff
# remove all SLES stuff and RHEL 6 stuff
rm -rf */tasks/SLES/
rm -f */vars/SLES_15.yml
rm -rf sap_hana_preconfigure/tasks/sapnote/1275776 # SLES - sapconf, saptune, etc
@ -236,6 +240,9 @@ popd
%endif
%changelog
* Fri Nov 25 2022 Than Ngo <than@redhat.com> - 3.3.0-4
- Resolves: #2143280, drop deprecated paramater for Ansible 2.14
* Thu Jul 14 2022 Than Ngo <than@redhat.com> - 3.3.0-3
- more fixes, update README.md
Related: #2101373