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

Authentication Issue when pinging to docker container using ansible ping module #251

Open
rajeshhereforyou opened this issue Apr 25, 2019 · 0 comments

Comments

@rajeshhereforyou
Copy link

rajeshhereforyou commented Apr 25, 2019

Hi,

I've docker community Edition (Version 18.06.1-ce-mac73 (26764)) and Ansible 2.7.10 installed on my mac.
Now I'm running a docker container with ubuntu image with the below command.

docker run --name mycontainer --hostname=mytargethost -p 22 -it ubuntu:trusty

and now I'm trying to connect to the above docker container using below ansible command

ansible -i inventory all -m ping

but I'm getting below error

target | UNREACHABLE! => {
"changed": false,
"msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in "/tmp". Failed command was: ( umask 77 && mkdir -p "echo ~/.ansible/tmp/ansible-tmp-1556218439.8837771-137578925211239" && echo ansible-tmp-1556218439.8837771-137578925211239="echo ~/.ansible/tmp/ansible-tmp-1556218439.8837771-137578925211239" ), exited with result 1",
"unreachable": true
}

This is what I've in my 'inventory' file

[docker-containers]
mycontainer ansible_connection=docker

Can someone suggest me what's the issue and how can i fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant