Skip to content
This repository was archived by the owner on May 27, 2024. It is now read-only.
This repository was archived by the owner on May 27, 2024. It is now read-only.

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

@rajeshhereforyou

Description

@rajeshhereforyou

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions