-
Notifications
You must be signed in to change notification settings - Fork 123
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
Inventory plugin should propagate docker_host variable #155
Comments
Thanks for the report! This definitely makes sense. I guess this would also apply to other configs that are needed to connect to the Docker daemon (like TLS setup). |
I've implemented this in #157. Can you please try it out whether it works for you? |
Dumb question: how can I install it? I tried the most obvious |
Here are some instructions on how you can try it locally: https://github.com/ansible/community-docs/blob/main/test_pr_locally_guide.rst |
In my deleted comment I found that ansible didn't pick up the cloned repo and ran my local docker 😊 The instructions didn't work: it refused to parse inventory (for some reason), although showed that there are 2 After that I see variables added into inventory and I've ran playbook. (Had local docker turned off completely this time). |
Thanks for testing the PR!
Hmm, it would be interesting to know why it didn't work, so we can improve the instructions. I guess "showed that there are 2 community.collections" means that you looked at the |
SUMMARY
I use inventory plugin with remote docker_host. However it is not propagated to the connection plugin and the latter uses default local connection.
ISSUE TYPE
COMPONENT NAME
community.docker.docker_containers
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Ubuntu 21.04
STEPS TO REPRODUCE
Inventory:
EXPECTED RESULTS
I can use those hosts in my playbook, they should connect to
my-host:2376
ACTUAL RESULTS
Playbook fails with:
However ansible-inventory successfully finds containers:
Workaround
To work around I added variable explicitly to inventory:
But this looks like a hack and unnecessary duplication.
The text was updated successfully, but these errors were encountered: