-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add yes
parameter to docker compose up
#1045
base: main
Are you sure you want to change the base?
Conversation
9da51ed
to
4bf5bd2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
The integration test failures are unrelated, the nightly tests were failing as well. (This started yesterday, after the release of Docker Compose 2.33.0.)
The --yes
option was added in Compose 2.32.0 (docker/compose#12363).
@@ -160,6 +160,12 @@ | |||
- When O(wait=true), wait at most this amount of seconds. | |||
type: int | |||
version_added: 3.8.0 | |||
yes: | |||
description: | |||
- When O(yes=true), pass C(--yes) to assume "yes" as answer to all prompts and run non-interactively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- When O(yes=true), pass C(--yes) to assume "yes" as answer to all prompts and run non-interactively. | |
- When O(yes=true), pass 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(yes=false) | |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
results in the question being answered by "no"
is not quite right. It actually causes the command to hang as it waits for stdin.
plugins/modules/docker_compose_v2.py
Outdated
@@ -160,6 +160,12 @@ | |||
- When O(wait=true), wait at most this amount of seconds. | |||
type: int | |||
version_added: 3.8.0 | |||
yes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure yes
is a good option name. One problem is that "yes" is a YAML 1.1 boolean value, so it will require quoting the option to be able to use it (unless Ansible does some magic).
How about approve_questions
or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's a good point. Perhaps assume_yes
is a little more obvious?
Could you also add a check to |
The problem is actually Docker CLI 28.0.0, which generates some unexpected stderr output. This has been fixed in docker/cli#5854, I hope there will be a bugfix release soon. |
Co-authored-by: Felix Fontein <felix@fontein.de>
SUMMARY
Add a variable for the
docker compose up
parameteryes
to assume "yes" as answer to all prompts and run non-interactively. This prevents issues where the module hangs if a volume spec changes in the compose file.ISSUE TYPE
COMPONENT NAME
docker_compose_v2
ADDITIONAL INFORMATION