dnf: allow for download_only to be run without root (#75532)

Fixes #75530
pull/75537/head
Martin Krizek 4 years ago committed by GitHub
parent 91319c5cfc
commit 9505f8c75d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
minor_changes:
- dnf - allow for ``download_only`` to be run without root privileges (https://github.com/ansible/ansible/issues/75530)

@ -1348,7 +1348,7 @@ class DnfModule(YumDnf):
else: else:
# Note: base takes a long time to run so we want to check for failure # Note: base takes a long time to run so we want to check for failure
# before running it. # 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( self.module.fail_json(
msg="This command has to be run under the root user.", msg="This command has to be run under the root user.",
results=[], results=[],

Loading…
Cancel
Save