summaryrefslogtreecommitdiff
path: root/lib/ansible/modules/dnf.py
diff options
context:
space:
mode:
authorMartin Krizek <martin.krizek@gmail.com>2021-08-19 21:20:53 +0200
committerGitHub <noreply@github.com>2021-08-20 05:20:53 +1000
commit9505f8c75d33825dad5f658b51d46418226d746e (patch)
treebe8cf5cba64f0bf385b0038c8c6d74941a2dfb72 /lib/ansible/modules/dnf.py
parent91319c5cfc523fb9dfb343be81ff373ec394818a (diff)
downloadansible-9505f8c75d33825dad5f658b51d46418226d746e.tar.gz
dnf: allow for download_only to be run without root (#75532)
Fixes #75530
Diffstat (limited to 'lib/ansible/modules/dnf.py')
-rw-r--r--lib/ansible/modules/dnf.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/modules/dnf.py b/lib/ansible/modules/dnf.py
index 6fddec3262..770f2ca4e7 100644
--- a/lib/ansible/modules/dnf.py
+++ b/lib/ansible/modules/dnf.py
@@ -1348,7 +1348,7 @@ class DnfModule(YumDnf):
else:
# Note: base takes a long time to run so we want to check for failure
# before running it.
- if not dnf.util.am_i_root():
+ if not self.download_only and not dnf.util.am_i_root():
self.module.fail_json(
msg="This command has to be run under the root user.",
results=[],