mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-04-17 17:48:27 +00:00
Use --yes if available.
This commit is contained in:
parent
c13b891bc9
commit
df02fa84d3
2
changelogs/fragments/1060-compose-yes.yml
Normal file
2
changelogs/fragments/1060-compose-yes.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- "docker_compose_v2 - use ``--yes`` instead of ``-y`` from Docker Compose 2.34.0 on (https://github.com/ansible-collections/community.docker/pull/1060)."
|
||||||
@ -162,7 +162,7 @@ options:
|
|||||||
version_added: 3.8.0
|
version_added: 3.8.0
|
||||||
assume_yes:
|
assume_yes:
|
||||||
description:
|
description:
|
||||||
- When O(assume_yes=true), pass C(-y) to assume "yes" as answer to all prompts and run non-interactively.
|
- When O(assume_yes=true), pass C(-y)/C(--yes) to assume "yes" as answer to all prompts and run non-interactively.
|
||||||
- Right now a prompt is asked whenever a non-matching volume should be re-created. O(assume_yes=false)
|
- Right now a prompt is asked whenever a non-matching volume should be re-created. O(assume_yes=false)
|
||||||
results in the question being answered by "no", which will simply re-use the existing volume.
|
results in the question being answered by "no", which will simply re-use the existing volume.
|
||||||
- This option is only available on Docker Compose 2.32.0 or newer.
|
- This option is only available on Docker Compose 2.32.0 or newer.
|
||||||
@ -537,8 +537,9 @@ class ServicesManager(BaseComposeManager):
|
|||||||
if dry_run:
|
if dry_run:
|
||||||
args.append('--dry-run')
|
args.append('--dry-run')
|
||||||
if self.yes:
|
if self.yes:
|
||||||
# Note that the long form is '--y', and not '--yes' as one would expect. Since this looks like a bug we're using the short form.
|
# Note that for Docker Compose 2.32.x and 2.33.x, the long form is '--y' and not '--yes'.
|
||||||
args.append('-y')
|
# This was fixed in Docker Compose 2.34.0 (https://github.com/docker/compose/releases/tag/v2.34.0).
|
||||||
|
args.append('-y' if self.compose_version < LooseVersion('2.34.0') else '--yes')
|
||||||
args.append('--')
|
args.append('--')
|
||||||
for service in self.services:
|
for service in self.services:
|
||||||
args.append(service)
|
args.append(service)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user