mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
apk: Add no-cache option (#548)
* apk: add no_cache option * Fix indentation
This commit is contained in:
parent
4c42d0971f
commit
7e17b55884
2 changed files with 18 additions and 0 deletions
2
changelogs/fragments/548_apk.yml
Normal file
2
changelogs/fragments/548_apk.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- apk - added ``no_cache`` option (https://github.com/ansible-collections/community.general/pull/548).
|
|
@ -30,6 +30,12 @@ options:
|
|||
- A package name, like C(foo), or multiple packages, like C(foo, bar).
|
||||
type: list
|
||||
elements: str
|
||||
no_cache:
|
||||
description:
|
||||
- Do not use any local cache path.
|
||||
type: bool
|
||||
default: 'no'
|
||||
version_added: 1.0.0
|
||||
repository:
|
||||
description:
|
||||
- A package repository or multiple repositories.
|
||||
|
@ -119,6 +125,12 @@ EXAMPLES = '''
|
|||
state: latest
|
||||
update_cache: yes
|
||||
repository: http://dl-3.alpinelinux.org/alpine/edge/main
|
||||
|
||||
- name: Install package without using cache
|
||||
apk:
|
||||
name: foo
|
||||
state: latest
|
||||
no_cache: yes
|
||||
'''
|
||||
|
||||
RETURN = '''
|
||||
|
@ -293,6 +305,7 @@ def main():
|
|||
argument_spec=dict(
|
||||
state=dict(default='present', choices=['present', 'installed', 'absent', 'removed', 'latest']),
|
||||
name=dict(type='list', elements='str'),
|
||||
no_cache=dict(default=False, type='bool'),
|
||||
repository=dict(type='list'),
|
||||
update_cache=dict(default=False, type='bool'),
|
||||
upgrade=dict(default=False, type='bool'),
|
||||
|
@ -311,6 +324,9 @@ def main():
|
|||
|
||||
p = module.params
|
||||
|
||||
if p['no_cache']:
|
||||
APK_PATH = "%s --no-cache" % (APK_PATH, )
|
||||
|
||||
# add repositories to the APK_PATH
|
||||
if p['repository']:
|
||||
for r in p['repository']:
|
||||
|
|
Loading…
Reference in a new issue