yum/dnf: Add download_dir param (#53171)

This commit is contained in:
Martin Krizek 2019-03-04 19:08:58 +01:00 committed by ansibot
commit 239fb1f68d
6 changed files with 89 additions and 4 deletions

View file

@ -197,6 +197,12 @@ options:
type: bool
default: "yes"
version_added: "2.8"
download_dir:
description:
- Specifies an alternate directory to store packages.
- Has an effect only if I(download_only) is specified.
type: str
version_added: "2.8"
notes:
- When used with a `loop:` each package will be processed individually,
it is much more efficient to pass the list directly to the `name` option.
@ -1385,6 +1391,9 @@ class YumModule(YumDnf):
if self.download_only:
self.yum_basecmd.extend(['--downloadonly'])
if self.download_dir:
self.yum_basecmd.extend(['--downloaddir=%s' % self.download_dir])
if self.installroot != '/':
# do not setup installroot by default, because of error
# CRITICAL:yum.cli:Config Error: Error accessing file for config file:////etc/yum.conf