From d63658ea791c3a8f0a2b672d153ee2265fbec6a1 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 9 Jun 2023 14:06:47 +0200 Subject: [PATCH] [PR #6646/621bedf7 backport][stable-7] redhat_subscription: officially deprecate "autosubscribe" (#6655) redhat_subscription: officially deprecate "autosubscribe" (#6646) The "autosubscribe" alias for the "auto_attach" option has been deprecated for many years, although only in the documentation. Officially mark it as deprecated also in the module parameters spec, slating it for removal in 9.0.0. (cherry picked from commit 621bedf7517cbea7863959435eaf1c4032250b00) Co-authored-by: Pino Toscano --- ...hat_subscription-deprecate-autosubscribe.yml | 6 ++++++ plugins/modules/redhat_subscription.py | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/6646-redhat_subscription-deprecate-autosubscribe.yml diff --git a/changelogs/fragments/6646-redhat_subscription-deprecate-autosubscribe.yml b/changelogs/fragments/6646-redhat_subscription-deprecate-autosubscribe.yml new file mode 100644 index 0000000000..491ea7cef7 --- /dev/null +++ b/changelogs/fragments/6646-redhat_subscription-deprecate-autosubscribe.yml @@ -0,0 +1,6 @@ +deprecated_features: +- | + redhat_subscription - the ``autosubscribe`` alias for the ``auto_attach`` option has been + deprecated for many years, although only in the documentation. Officially mark this alias + as deprecated, and it will be removed in community.general 9.0.0 + (https://github.com/ansible-collections/community.general/pull/6646). diff --git a/plugins/modules/redhat_subscription.py b/plugins/modules/redhat_subscription.py index 79b0d4b4c9..3340a3c9cf 100644 --- a/plugins/modules/redhat_subscription.py +++ b/plugins/modules/redhat_subscription.py @@ -122,7 +122,10 @@ options: auto_attach: description: - Upon successful registration, auto-consume available subscriptions - - Added in favor of deprecated autosubscribe in 2.5. + - | + Added in favor of the deprecated I(autosubscribe) option in + Ansible 2.5; please note that I(autosubscribe) will be removed in + community.general 9.0.0. type: bool aliases: [autosubscribe] activationkey: @@ -1074,7 +1077,17 @@ def main(): 'server_port': {}, 'rhsm_baseurl': {}, 'rhsm_repo_ca_cert': {}, - 'auto_attach': {'aliases': ['autosubscribe'], 'type': 'bool'}, + 'auto_attach': { + 'type': 'bool', + 'aliases': ['autosubscribe'], + 'deprecated_aliases': [ + { + 'name': 'autosubscribe', + 'version': '9.0.0', + 'collection_name': 'community.general', + }, + ], + }, 'activationkey': {'no_log': True}, 'org_id': {}, 'environment': {},