-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
Discrepancy in results from Docker container started with Ansible docker_container versus Docker CLI commands #49802
Comments
Files identified in the description: If these files are inaccurate, please update the |
Have you tried to run It might help to first just create the containers (without starting them) and see what the differences are before the containers are started (otherwise one difference will be that one of them is running and the other one not). |
Are you sure that this image is working at all? When I run that image with the same settings as yours, it fails just as you describe, completely outside of Ansible. needs_info
|
@felixfontein I did as you suggested. Aside from the usual expected differences (timestamps, randomly generated alphanumerice sequences), there are a few curious differences, like where Docker puts unifi_docker_cli.txt @DBendit It does work. I even checked by connecting to the container from my web browser, and I got the Unifi controller setup wizard. (Don't forget to open port 8443 first on the Docker host's firewall!)
Some further investigation has revealed that creating and starting it from Ansible does work...if I leave the |
Can you try Besides that, the CLI version has
while the Ansible version has
The other differences look harmless. |
Arrgh! That was the solution indeed. Of course it's something small and simple and easily overlooked. Sorry for wasting everyone's time with a PEBKAC error. |
@MacDhughaill Nope, this is a failing on our end. We should handle this input properly. |
Hey! I contributed by finding an actual bug! Will this fix show up in 2.7 at all, or will it have to wait for 2.8? I just want to know so I can put a reminder comment in my playbook. |
@DBendit it isn't, it's a failing on YAML's end. It is impossible to handle this correctly with YAML. |
(Except by failing and telling the user to quote ambiguous values.) |
@MacDhughaill when backported, it should appear in the next 2.7.x version released after the backport was merged. There will be a 2.7.x release this week (which definitely won't contain any change related to this, since the merge window for that one closed this monday). It's definitely something you have to fix in your playbook, though, since it is impossible to know what you wrote in your playbook once you end up with a YAML boolean. It could have also been |
* [docker_container] Failing on non-string env values Fixes #49802 * Clarify failure message Co-Authored-By: DBendit <David@ibendit.com> * Fixup from review
* [docker_container] Failing on non-string env values Fixes ansible#49802 * Clarify failure message Co-Authored-By: DBendit <David@ibendit.com> * Fixup from review
* [docker_container] Failing on non-string env values Fixes ansible#49802 * Clarify failure message Co-Authored-By: DBendit <David@ibendit.com> * Fixup from review (cherry picked from commit d62d717)
* [docker_container] Failing on non-string env values (#49843) * [docker_container] Failing on non-string env values Fixes #49802 * Clarify failure message Co-Authored-By: DBendit <David@ibendit.com> * Fixup from review (cherry picked from commit d62d717) * Turn fail into warning for 2.7 backport. * Fix test for backport The behaviour in the backport is to warn rather than error
SUMMARY
When I use the following Docker CLI commands, the container successfully starts up and runs normally.
When I use
docker_container
in an Ansible playbook with the equivalent options, the playbook completes successfully, but the container immediately afterwards exits with an error code of "1".ISSUE TYPE
COMPONENT NAME
docker_container
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Ansible controller:
Fedora 28
Ansible host (aka the computer I'm trying to run the Docker container on):
CentOS 7 with a virtualenv to provide the newer
docker
Python libraryDocker is installed from the stable repository as described in their docs
STEPS TO REPRODUCE
EXPECTED RESULTS
I expect the container to continue running normally after it is started, in the same way as it would if I used Docker CLI commands.
ACTUAL RESULTS
The playbook completes successfully. The container is successfully started, but it immediately exits with error code "1".
The text was updated successfully, but these errors were encountered: