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

Adding while loop to wait for cluster container creation #4039

Conversation

tman5
Copy link
Contributor

@tman5 tman5 commented Jan 13, 2022

SUMMARY

Fixes #3999

In a cluster scenario where the node running the Ansible creates a container on another node in the cluster, the playbook would fail because the Status != Success it was equal to running because the container wasn't created yet and took a bit. This will keep checking the status while it is running and then proceed once it is no longer listed as running.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lxd module_util

ADDITIONAL INFORMATION

If the containers are all created on the node which the Ansible is executing on, the problem will never show itself.

See this discussion too: https://discuss.linuxcontainers.org/t/lxd-cluster-launch-command-creates-container-on-different-node-is-it-possible-to-disable-this-by-default/8389/8

Related: ansible/ansible#53426 (comment)


@ansibullbot ansibullbot added bug This issue/PR relates to a bug module_utils module_utils needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor plugins plugin (any type) and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Jan 13, 2022
Copy link
Collaborator

@felixfontein felixfontein left a 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.

changelogs/fragments/4039-cluster-container-wait.yml Outdated Show resolved Hide resolved
plugins/module_utils/lxd.py Outdated Show resolved Hide resolved
@felixfontein felixfontein added backport-4 check-before-release PR will be looked at again shortly before release and merged if possible. labels Jan 16, 2022
@ansibullbot ansibullbot added cloud module module needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Jan 19, 2022
changelogs/fragments/4039-cluster-container-wait.yml Outdated Show resolved Hide resolved
changelogs/fragments/4039-cluster-container-wait.yml Outdated Show resolved Hide resolved
plugins/modules/cloud/lxd/lxd_container.py Outdated Show resolved Hide resolved
plugins/modules/cloud/lxd/lxd_container.py Outdated Show resolved Hide resolved
plugins/modules/cloud/lxd/lxd_container.py Show resolved Hide resolved
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Looks good to me. If nobody complains, I'll merge this in a week or so.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Jan 28, 2022
@felixfontein felixfontein merged commit 7aab449 into ansible-collections:main Jan 28, 2022
@patchback
Copy link

patchback bot commented Jan 28, 2022

Backport to stable-4: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-4/7aab4497acb1c8172c3906120eb599b29604513e/pr-4039

Backported as #4095

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein
Copy link
Collaborator

@tman5 thanks for your contribution!

patchback bot pushed a commit that referenced this pull request Jan 28, 2022
* Adding while loop to wait

* Adding changelog fragment

* Adding parameter and more docs

* Adjusting docs

Co-authored-by: Travis Scotto <tscotto@webstaurantstore.com>
(cherry picked from commit 7aab449)
felixfontein pushed a commit that referenced this pull request Jan 28, 2022
* Adding while loop to wait

* Adding changelog fragment

* Adding parameter and more docs

* Adjusting docs

Co-authored-by: Travis Scotto <tscotto@webstaurantstore.com>
(cherry picked from commit 7aab449)

Co-authored-by: tman5 <10875976+tman5@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug cloud module_utils module_utils module module new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LXD containers cluster issue
3 participants