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 - #65993 - update restart policy (restart policy & restart retries) wit… #66192
docker_container - #65993 - update restart policy (restart policy & restart retries) wit… #66192
Conversation
…hout restarting the container
The test
|
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.
Besides the comments below, you also need to add a changelog fragment: https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#changelogs-how-to
Something like
bugfixes:
- "docker_container - changes to ``restart_policy`` and ``restart_retries`` now update the container instead of recreating it, if supported by the docker daemon."
- set restart_policy to the correct value independent from the api version
- add a new variable for the restart_policy configuration value
All done. Many thanks for the review and all your input! Some of them are smart solutions to things I was not completely satisfied by before. |
changelogs/fragments/65993-restart-docker-container-on-restart-policy-updates.yaml
Outdated
Show resolved
Hide resolved
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.
shipit
@winem thanks a lot for fixing this! I'll create backport PRs so this fix will propagate to 2.9.x and 2.8.x. |
…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)
Thanks for your input. This was really helpful to get "back" into programming and is appreciated. I'll take a look at your activities regarding the backport, too. Great chance to learn. |
…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
Fixes #65993 and allows to change the restart policy without restarting the container.
ISSUE TYPE
COMPONENT NAME
lib/ansible/modules/cloud/docker/docker_container.py
ADDITIONAL INFORMATION
I ran several test cases on my own dev environment and hope that I covered all cases.
Let me share one of the minified inventories to test it: