From 2c5a2e1a382d92d8f011409360fac64f6eef7f5a Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Nov 01 2023 21:00:55 +0000 Subject: Update to 8.0.0. --- diff --git a/.gitignore b/.gitignore index a599378..b1218f5 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ /ansible-collection-community-general-7.1.0.tar.gz /ansible-collection-community-general-7.2.1.tar.gz /ansible-collection-community-general-7.5.0.tar.gz +/ansible-collection-community-general-8.0.0.tar.gz diff --git a/ansible-collection-community-general.spec b/ansible-collection-community-general.spec index 6e52bcb..2014f59 100644 --- a/ansible-collection-community-general.spec +++ b/ansible-collection-community-general.spec @@ -1,5 +1,5 @@ Name: ansible-collection-community-general -Version: 7.5.0 +Version: 8.0.0 Release: 1%{?dist} Summary: Modules and plugins supported by Ansible community @@ -61,8 +61,6 @@ Source: %{furl}/archive/%{version_no_tilde}/%{name}-%{version}.tar.gz # also removed. # This is a downstream only patch. Patch: build_ignore.patch -# redhat_subscription: fix D-Bus option for consumer type on older distros #7378 -Patch: %{furl}/pull/7378.patch#/redhat_subscription-dbus-consumer.patch BuildRequires: ansible-packaging # Version 5 specifically requires ansible-core 2.11 or above @@ -88,6 +86,9 @@ find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{ %doc README.md CHANGELOG.rst* %changelog +* Wed Nov 01 2023 Maxwell G - 8.0.0-1 +- Update to 8.0.0. + * Tue Oct 10 2023 Maxwell G - 7.5.0-1 - Update to 7.5.0. Fixes rhbz#2232352. - Backport redhat_subscription patch. Fixes rhbz#2242824. diff --git a/redhat_subscription-dbus-consumer.patch b/redhat_subscription-dbus-consumer.patch deleted file mode 100644 index 34de04e..0000000 --- a/redhat_subscription-dbus-consumer.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 9f09acb8fea3936d5e47930e964a0737c106b21a Mon Sep 17 00:00:00 2001 -From: Pino Toscano -Date: Tue, 10 Oct 2023 10:47:32 +0200 -Subject: [PATCH] redhat_subscription: fix D-Bus option for consumer type on - older distros -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -subscription-manager 1.29.32 renames the "type" D-Bus registration -option to "consumer_type"; this means that the right option must be -passed according to the distro type & version. - -Copy the same approach done for environments, tweaking the version -needed: this change is found in RHEL 9.2+ and supported Fedora versions. - -Reported-by: Radek Bíba ---- - ...edhat_subscription-dbus-consumer-type.yaml | 6 ++++ - plugins/modules/redhat_subscription.py | 29 ++++++++++++++++++- - 2 files changed, 34 insertions(+), 1 deletion(-) - create mode 100644 changelogs/fragments/7378-redhat_subscription-dbus-consumer-type.yaml - -diff --git a/changelogs/fragments/7378-redhat_subscription-dbus-consumer-type.yaml b/changelogs/fragments/7378-redhat_subscription-dbus-consumer-type.yaml -new file mode 100644 -index 00000000000..c1ec80ae21a ---- /dev/null -+++ b/changelogs/fragments/7378-redhat_subscription-dbus-consumer-type.yaml -@@ -0,0 +1,6 @@ -+bugfixes: -+ - | -+ redhat_subscription - use the right D-Bus options for the consumer type when -+ registering a RHEL system older than 9 or a RHEL 9 system older than 9.2 -+ and using ``consumer_type`` -+ (https://github.com/ansible-collections/community.general/pull/7378). -diff --git a/plugins/modules/redhat_subscription.py b/plugins/modules/redhat_subscription.py -index 3e49504d932..50ae25d0a39 100644 ---- a/plugins/modules/redhat_subscription.py -+++ b/plugins/modules/redhat_subscription.py -@@ -572,7 +572,34 @@ def str2int(s, default=0): - - register_opts = {} - if consumer_type: -- register_opts['consumer_type'] = consumer_type -+ # The option for the consumer type used to be 'type' in versions -+ # of RHEL before 9 & in RHEL 9 before 9.2, and then it changed to -+ # 'consumer_type'; since the Register*() D-Bus functions reject -+ # unknown options, we have to pass the right option depending on -+ # the version -- funky. -+ def supports_option_consumer_type(): -+ # subscription-manager in any supported Fedora version -+ # has the new option. -+ if distro_id == 'fedora': -+ return True -+ # Check for RHEL 9 >= 9.2, or RHEL >= 10. -+ if distro_id == 'rhel' and \ -+ ((distro_version[0] == 9 and distro_version[1] >= 2) or -+ distro_version[0] >= 10): -+ return True -+ # CentOS: since the change was only done in EL 9, then there is -+ # only CentOS Stream for 9, and thus we can assume it has the -+ # latest version of subscription-manager. -+ if distro_id == 'centos' and distro_version[0] >= 9: -+ return True -+ # Unknown or old distro: assume it does not support -+ # the new option. -+ return False -+ -+ consumer_type_key = 'type' -+ if supports_option_consumer_type(): -+ consumer_type_key = 'consumer_type' -+ register_opts[consumer_type_key] = consumer_type - if consumer_name: - register_opts['name'] = consumer_name - if consumer_id: diff --git a/sources b/sources index e96441b..73f7f05 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ansible-collection-community-general-7.5.0.tar.gz) = 71941e9b09c4a13bc42ad0cf0c0194e7b85538c77c2a8808ac767f4c84d42e77fb5f4723d42f11ba2db7af63e6769580b33ed7ff28f33e3eae9418f185b8901f +SHA512 (ansible-collection-community-general-8.0.0.tar.gz) = 712736176be78be11349153dcef093ceec06529df92c4f59e2519586a3c79b993d648087ee0b58b13eb3b525978374484f6e86e674bbe14e723384e0ce95d69c