summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoît Knecht <bknecht@protonmail.ch>2022-08-17 19:56:24 +0200
committerGitHub <noreply@github.com>2022-08-17 13:56:24 -0400
commit2e8082ebb0faf042a26f5c51fa70b9ce0a819f43 (patch)
tree662a3ab77b55c868da3e0c410f951f99d5035bdd
parentbf1ef5a1f3562c9a59168adbc78750304c3e4309 (diff)
downloadansible-2e8082ebb0faf042a26f5c51fa70b9ce0a819f43.tar.gz
yum_repository: Do not set default value for async (#76750)
* 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 <bknecht@protonmail.ch> * 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>
-rw-r--r--changelogs/fragments/75364-yum-repository-async.yml2
-rw-r--r--lib/ansible/modules/yum_repository.py7
2 files changed, 7 insertions, 2 deletions
diff --git a/changelogs/fragments/75364-yum-repository-async.yml b/changelogs/fragments/75364-yum-repository-async.yml
new file mode 100644
index 0000000000..14b8546428
--- /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 119ce3071e..52e176d966 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,