Skip to content
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_swarm: fix force when state==present #53003

Merged
merged 1 commit into from Feb 27, 2019

Conversation

felixfontein
Copy link
Contributor

SUMMARY

The documentation claims about the force option: Use with state C(present) to force creating a new Swarm, even if already part of one.

Unfortunately, that doesn't work:

  1. When the daemon is already in swarm mode, init_swarm() will never be called;
  2. The force_new_cluster argument of init_swarm() is set to self.parameters.force_new_cluster, which is only ever set to None.
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

docker_swarm

@ansibot
Copy link
Contributor

ansibot commented Feb 26, 2019

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. cloud community_review In order to be merged, this PR must follow the community review workflow. docker module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. test This PR relates to tests. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Feb 26, 2019
@felixfontein
Copy link
Contributor Author

ready_for_review

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Feb 26, 2019
@@ -416,15 +415,15 @@ def inspect_swarm(self):
return

def init_swarm(self):
if self.__isSwarmManager():
if not self.force and self.__isSwarmManager():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will overwrite #52886 changes, you need to rebase it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to rebase it anyway since there are now conflicts ;)

@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. needs_triage Needs a first human triage before being processed. labels Feb 26, 2019
@ansibot ansibot removed the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Feb 26, 2019
@felixfontein
Copy link
Contributor Author

ready_for_review

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Feb 26, 2019
@WojciechowskiPiotr
Copy link
Contributor

shipit

@ansibot ansibot added shipit This PR is ready to be merged by Core and removed community_review In order to be merged, this PR must follow the community review workflow. labels Feb 26, 2019
@gundalow gundalow merged commit 76e0e00 into ansible:devel Feb 27, 2019
@felixfontein felixfontein deleted the docker_swarm-force-recreation branch February 27, 2019 09:17
@felixfontein
Copy link
Contributor Author

@WojciechowskiPiotr thanks for reviewing!
@gundalow thanks for merging!

felixfontein added a commit to felixfontein/ansible that referenced this pull request Feb 28, 2019
abadger pushed a commit that referenced this pull request Mar 1, 2019
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. cloud docker module This issue/PR relates to a module. shipit This PR is ready to be merged by Core support:community This issue/PR relates to code supported by the Ansible community. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants