From eca6494503c7866de714b579af8a81b9c7fe2364 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 23 Apr 2023 18:49:20 +0200 Subject: [PATCH] [PR #6401/486c47f9 backport][stable-6] rhsm_release: removing required=true for 'release' option (#6409) rhsm_release: removing required=true for 'release' option (#6401) Fix rhsm_release by removing required=true for 'release' option. (cherry picked from commit 486c47f922dfb3a4712f28572a6c44fe3540bbaa) Co-authored-by: Felix Fontein --- changelogs/fragments/6401-rhsm_release-required.yml | 2 ++ plugins/modules/rhsm_release.py | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 changelogs/fragments/6401-rhsm_release-required.yml diff --git a/changelogs/fragments/6401-rhsm_release-required.yml b/changelogs/fragments/6401-rhsm_release-required.yml new file mode 100644 index 0000000000..bf47fa8237 --- /dev/null +++ b/changelogs/fragments/6401-rhsm_release-required.yml @@ -0,0 +1,2 @@ +bugfixes: + - "rhsm_release - make ``release`` parameter not required so it is possible to pass ``null`` as a value. This only was possible in the past due to a bug in ansible-core that now has been fixed (https://github.com/ansible-collections/community.general/pull/6401)." diff --git a/plugins/modules/rhsm_release.py b/plugins/modules/rhsm_release.py index 037c3fbec8..6ac4da6e4f 100644 --- a/plugins/modules/rhsm_release.py +++ b/plugins/modules/rhsm_release.py @@ -32,8 +32,8 @@ attributes: options: release: description: - - RHSM release version to use (use null to unset) - required: true + - RHSM release version to use. + - To unset either pass C(null) for this option, or omit this option. type: str author: - Sean Myers (@seandst) @@ -43,17 +43,17 @@ EXAMPLES = ''' # Set release version to 7.1 - name: Set RHSM release version community.general.rhsm_release: - release: "7.1" + release: "7.1" # Set release version to 6Server - name: Set RHSM release version community.general.rhsm_release: - release: "6Server" + release: "6Server" # Unset release version - name: Unset RHSM release release community.general.rhsm_release: - release: null + release: null ''' RETURN = ''' @@ -107,7 +107,7 @@ def set_release(module, release): def main(): module = AnsibleModule( argument_spec=dict( - release=dict(type='str', required=True), + release=dict(type='str'), ), supports_check_mode=True )