mirror of
https://github.com/ansible-collections/community.docker.git
synced 2025-12-15 19:42:06 +00:00
add renew_anon_volumes parameter to docker compose up (#977)
* add `renew_anon_volumes` parameter to `docker compose up` * Apply suggestions from code review Apply suggested changes to Documentation Co-authored-by: Felix Fontein <felix@fontein.de> * Fix sanity check error apply suggestion from code review Co-authored-by: Felix Fontein <felix@fontein.de> * add changelog fragment for PR #977 * apply suggested changes to changelog fragment Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Christoph Sieber <Christoph.Sieber@telekom.de> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
309a30e9be
commit
be5564d4de
3
changelogs/fragments/977-renew_anon_volumes.yaml
Normal file
3
changelogs/fragments/977-renew_anon_volumes.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
minor_changes:
|
||||
- docker_compose_v2 - add ``renew_anon_volumes`` parameter for ``docker compose up`` (https://github.com/ansible-collections/community.docker/pull/977).
|
||||
@ -93,6 +93,13 @@ options:
|
||||
- always
|
||||
- never
|
||||
- auto
|
||||
renew_anon_volumes:
|
||||
description:
|
||||
- Whether to recreate instead of reuse anonymous volumes from previous containers.
|
||||
- V(true) is equivalent to the C(--renew-anon-volumes) option of C(docker compose up).
|
||||
type: bool
|
||||
default: false
|
||||
version_added: 4.0.0
|
||||
remove_images:
|
||||
description:
|
||||
- Use with O(state=absent) to remove all images or only local images.
|
||||
@ -436,6 +443,7 @@ class ServicesManager(BaseComposeManager):
|
||||
self.remove_images = parameters['remove_images']
|
||||
self.remove_volumes = parameters['remove_volumes']
|
||||
self.remove_orphans = parameters['remove_orphans']
|
||||
self.renew_anon_volumes = parameters['renew_anon_volumes']
|
||||
self.timeout = parameters['timeout']
|
||||
self.services = parameters['services'] or []
|
||||
self.scale = parameters['scale'] or {}
|
||||
@ -478,6 +486,8 @@ class ServicesManager(BaseComposeManager):
|
||||
args.append('--force-recreate')
|
||||
if self.recreate == 'never':
|
||||
args.append('--no-recreate')
|
||||
if self.renew_anon_volumes:
|
||||
args.append('--renew-anon-volumes')
|
||||
if not self.dependencies:
|
||||
args.append('--no-deps')
|
||||
if self.timeout is not None:
|
||||
@ -620,6 +630,7 @@ def main():
|
||||
pull=dict(type='str', choices=['always', 'missing', 'never', 'policy'], default='policy'),
|
||||
build=dict(type='str', choices=['always', 'never', 'policy'], default='policy'),
|
||||
recreate=dict(type='str', default='auto', choices=['always', 'never', 'auto']),
|
||||
renew_anon_volumes=dict(type='bool', default=False),
|
||||
remove_images=dict(type='str', choices=['all', 'local']),
|
||||
remove_volumes=dict(type='bool', default=False),
|
||||
remove_orphans=dict(type='bool', default=False),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user