Is your ssh key password protected and if so did you configured forwarding
in the ssh-agent or a similar work around?

On Sat, Jul 6, 2019, 3:07 PM Indian Velumani <post4ind...@gmail.com> wrote:

> Hi,
>
> When want to start a docker image as container means you have run a
> command like
> docker run -d (image: version).
> On there just add like this
> docker run --net=host -d (image: version)
> Then login to the docker using
> docker exec command
> Then execute your ansible playbook.
>
> On Sun, Jul 7, 2019, 00:18 Claudio Rivas <clsri...@gmail.com> wrote:
>
>> Thank you for your quick response, but where do you suggest to run it? In
>> my case the element that has Ansible is a Docker container. Docker
>> container have Jenkins and Ansible.
>> Ansible script doesn't run any Docker command actually. Sorry is my
>> question sounds dumb but I'm new to Docker and Ansible.
>>
>> Best regards,
>>
>>
>> On Saturday, July 6, 2019 at 1:33:14 PM UTC-5, Indian Velumani wrote:
>>>
>>> Hi,
>>>
>>> Run docker command with --net=host.
>>>
>>> Thanks.
>>>
>>> On Sun, Jul 7, 2019, 00:00 Claudio Rivas <clsr...@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I'm trying to connect to remote host through SSH and a Private Key to
>>>> run a simple test to start working with Ansible to generate my inventories:
>>>>
>>>> ansible -m ping -i hosts test1 -vvv
>>>>
>>>>
>>>> Hosts file have a simple configuration
>>>>
>>>> [test]
>>>>
>>>>
>>>> test1 ansible_host=remote_host ansible_user=remote_user
>>>> ansible_private_key_file=/var/jenkins_home/ansible/id_rsa
>>>>
>>>> SSH is working fine to connect to remote server with this key:
>>>>
>>>> jenkins@0bde7f6019a2:~/ansible$ ssh -i id_rsa remote_user@remote_host
>>>>
>>>> Enter passphrase for key 'id_rsa':
>>>>
>>>> Last login: Fri Jul  5 12:10:51 2019 from jenkins.jenkins_net
>>>>
>>>> While trying to do the connection with ansible seems to have problems I
>>>> can't find or troubleshoot, the error indicates:
>>>>
>>>> *test1 | UNREACHABLE! => {*
>>>>
>>>> *    "changed": false, *
>>>>
>>>> *    "msg": "Failed to connect to the host via ssh: Control socket
>>>> connect(/var/jenkins_home/.ansible/cp/45a4bb8b49): Connection
>>>> refused\r\nFailed to connect to new control master", *
>>>>
>>>> *    "unreachable": true*
>>>>
>>>> *}*
>>>>
>>>>
>>>> Any help will or advice be appreciated.
>>>>
>>>>
>>>> Best regards,
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Ansible Project" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to ansible...@googlegroups.com.
>>>> To post to this group, send email to ansible...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/ansible-project/41557231-d666-4af9-9c1c-aedfc54fd0b9%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/ansible-project/41557231-d666-4af9-9c1c-aedfc54fd0b9%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to ansible-project+unsubscr...@googlegroups.com.
>> To post to this group, send email to ansible-project@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/400d32d7-b25c-4888-b276-4d4ba348b7f4%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/400d32d7-b25c-4888-b276-4d4ba348b7f4%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAAcjD-XS6OVe3f5LLvSLpQ%2BMBtriMdRA%2BuAFWK28bUJ-UEXM3A%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAAcjD-XS6OVe3f5LLvSLpQ%2BMBtriMdRA%2BuAFWK28bUJ-UEXM3A%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAHg2U9Mx_GnpJ-kkgMfj_CX8DxiEAZLswhx3CzErLRO%3Dz6PFUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to