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
docker_container: Always recreates the container when restart_policy is changed #65993
Comments
Files identified in the description: If these files are inaccurate, please update the |
!component docker_container |
Hmm I think that's not how it's supposed to work |
!component =lib/ansible/modules/cloud/docker/ |
I am already working on a PR. Actually not a big deal but I have to put bit more time to do it right and not violate the currently very clear structure of the module. |
Files identified in the description: If these files are inaccurate, please update the |
!component =lib/ansible/modules/cloud/docker/docker_container.py |
Files identified in the description: If these files are inaccurate, please update the |
Just put |
Ah sounds great! I'm looking forward for the PR!
Sure, will do! A markdown link is not working then, noted. |
@idelsink the Docker documentation does not mention anything like a minimum required API version for example. Do you know any restrictions or dependencies like that? I am just wondering why the restart policy was not handled like the other supported Docker update versions. I'm quite busy at the moment but will create the PR end of next week, latest. :) |
@winem does that mean you didn't start with the PR so far? In that case, do you mind if I don't wait and create a PR now? |
@felixfontein, sorry, was not sure if I get to it today but I actually just did and created the PR. Any review and feedback is highly appreciated. |
…estart retries) wit… (#66192) * #65993 - update restart policy (restart policy & restart retries) without restarting the container * - proper indentation on the continuation-line - set restart_policy to the correct value independent from the api version * - move restart_policy definitions into the if block - add a new variable for the restart_policy configuration value * add changelog fragment * typo; minus -> underscore * rename changelog fragment to contain the correct module name * rename restart_policy_config_value to just restart_policy and refer to the correct dict values
…icy & restart retries) wit… (ansible#66192) * ansible#65993 - update restart policy (restart policy & restart retries) without restarting the container * - proper indentation on the continuation-line - set restart_policy to the correct value independent from the api version * - move restart_policy definitions into the if block - add a new variable for the restart_policy configuration value * add changelog fragment * typo; minus -> underscore * rename changelog fragment to contain the correct module name * rename restart_policy_config_value to just restart_policy and refer to the correct dict values (cherry picked from commit 02c126f)
…icy & restart retries) wit… (ansible#66192) * ansible#65993 - update restart policy (restart policy & restart retries) without restarting the container * - proper indentation on the continuation-line - set restart_policy to the correct value independent from the api version * - move restart_policy definitions into the if block - add a new variable for the restart_policy configuration value * add changelog fragment * typo; minus -> underscore * rename changelog fragment to contain the correct module name * rename restart_policy_config_value to just restart_policy and refer to the correct dict values (cherry picked from commit 02c126f)
…estart retries) wit… (#66192) * #65993 - update restart policy (restart policy & restart retries) without restarting the container * - proper indentation on the continuation-line - set restart_policy to the correct value independent from the api version * - move restart_policy definitions into the if block - add a new variable for the restart_policy configuration value * add changelog fragment * typo; minus -> underscore * rename changelog fragment to contain the correct module name * rename restart_policy_config_value to just restart_policy and refer to the correct dict values (cherry picked from commit 02c126f)
…estart retries) wit… (#66192) * #65993 - update restart policy (restart policy & restart retries) without restarting the container * - proper indentation on the continuation-line - set restart_policy to the correct value independent from the api version * - move restart_policy definitions into the if block - add a new variable for the restart_policy configuration value * add changelog fragment * typo; minus -> underscore * rename changelog fragment to contain the correct module name * rename restart_policy_config_value to just restart_policy and refer to the correct dict values (cherry picked from commit 02c126f)
SUMMARY
The docker_container module recreates a container when the
restart_policy
is changed. This can be changed using thedocker update
command.ISSUE TYPE
COMPONENT NAME
docker_container
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
restart_policy
toalways
and run it again.docker ps
command that the container is recreated instead of updated.EXPECTED RESULTS
I expect the container to be update with the new
restart_policy
by using the docker update command:ACTUAL RESULTS
The container is recreated instead of updated.
I currently run a
command
task before the container which updates the command.The text was updated successfully, but these errors were encountered: