From 2e8082ebb0faf042a26f5c51fa70b9ce0a819f43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Knecht?= Date: Wed, 17 Aug 2022 19:56:24 +0200 Subject: [PATCH] yum_repository: Do not set default value for async (#76750) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * yum_repository: Do not set default value for async The `async` repository option is deprecated in RHEL 8, but Ansible sets ```ini async = 1 ``` even when it's omitted from the module options, which causes `dnf` to complain about an unknown configuration option. This commit removes the default value from the `async` parameter, which means it won't be added to the repository file if omitted from the module parameters. Signed-off-by: BenoƮt Knecht * Document the specific versions with the default True and the option deprecation for RHEL 8 Co-authored-by: s-hertel <19572925+s-hertel@users.noreply.github.com> --- changelogs/fragments/75364-yum-repository-async.yml | 2 ++ lib/ansible/modules/yum_repository.py | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/75364-yum-repository-async.yml diff --git a/changelogs/fragments/75364-yum-repository-async.yml b/changelogs/fragments/75364-yum-repository-async.yml new file mode 100644 index 00000000000..14b85464287 --- /dev/null +++ b/changelogs/fragments/75364-yum-repository-async.yml @@ -0,0 +1,2 @@ +minor_changes: +- yum_repository - do not give the ``async`` parameter a default value anymore, since this option is deprecated in RHEL 8. This means that ``async = 1`` won't be added to repository files if omitted, but it can still be set explicitly if needed. diff --git a/lib/ansible/modules/yum_repository.py b/lib/ansible/modules/yum_repository.py index 119ce3071e8..52e176d9669 100644 --- a/lib/ansible/modules/yum_repository.py +++ b/lib/ansible/modules/yum_repository.py @@ -23,8 +23,11 @@ options: description: - If set to C(yes) Yum will download packages and metadata from this repo in parallel, if possible. + - In ansible-core 2.11, 2.12, and 2.13 the default value is C(true). + - This option has been deprecated in RHEL 8. If you're using one of the + versions listed above, you can set this option to None to avoid passing an + unknown configuration option. type: bool - default: 'yes' bandwidth: description: - Maximum available network bandwidth in bytes/second. Used with the @@ -648,7 +651,7 @@ def main(): username=dict(), ) - argument_spec['async'] = dict(type='bool', default=True) + argument_spec['async'] = dict(type='bool') module = AnsibleModule( argument_spec=argument_spec,