yum: improve disk usage when update_cache used (#21098)
* Marks metadata files as outdated Eliminates time records of the metadata and mirrorlists download for each repository. This forces yum to revalidate the cache for each repository the next time it is used. * Command arguments in two separate strings to be compatible if run_command implementation changes. Doc explains a little better what is that parameter doing
This commit is contained in:
parent
44e92d1c40
commit
e1761d7724
1 changed files with 5 additions and 5 deletions
|
@ -96,13 +96,13 @@ options:
|
||||||
|
|
||||||
update_cache:
|
update_cache:
|
||||||
description:
|
description:
|
||||||
- Force updating the cache. Has an effect only if state is I(present)
|
- Force yum to check if cache is out of date and redownload if needed.
|
||||||
or I(latest).
|
Has an effect only if state is I(present) or I(latest).
|
||||||
required: false
|
required: false
|
||||||
version_added: "1.9"
|
version_added: "1.9"
|
||||||
default: "no"
|
default: "no"
|
||||||
choices: ["yes", "no"]
|
choices: ["yes", "no"]
|
||||||
aliases: []
|
aliases: [ "expire-cache" ]
|
||||||
|
|
||||||
validate_certs:
|
validate_certs:
|
||||||
description:
|
description:
|
||||||
|
@ -1081,7 +1081,7 @@ def ensure(module, state, pkgs, conf_file, enablerepo, disablerepo,
|
||||||
if state in ['installed', 'present', 'latest']:
|
if state in ['installed', 'present', 'latest']:
|
||||||
|
|
||||||
if module.params.get('update_cache'):
|
if module.params.get('update_cache'):
|
||||||
module.run_command(yum_basecmd + ['makecache'])
|
module.run_command(yum_basecmd + ['clean', 'expire-cache'])
|
||||||
|
|
||||||
my = yum_base(conf_file, installroot)
|
my = yum_base(conf_file, installroot)
|
||||||
try:
|
try:
|
||||||
|
@ -1145,7 +1145,7 @@ def main():
|
||||||
list=dict(),
|
list=dict(),
|
||||||
conf_file=dict(default=None),
|
conf_file=dict(default=None),
|
||||||
disable_gpg_check=dict(required=False, default="no", type='bool'),
|
disable_gpg_check=dict(required=False, default="no", type='bool'),
|
||||||
update_cache=dict(required=False, default="no", type='bool'),
|
update_cache=dict(required=False, default="no", aliases=['expire-cache'], type='bool'),
|
||||||
validate_certs=dict(required=False, default="yes", type='bool'),
|
validate_certs=dict(required=False, default="yes", type='bool'),
|
||||||
installroot=dict(required=False, default="/", type='str'),
|
installroot=dict(required=False, default="/", type='str'),
|
||||||
# this should not be needed, but exists as a failsafe
|
# this should not be needed, but exists as a failsafe
|
||||||
|
|
Loading…
Reference in a new issue