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 <javascript:>> 
> 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 <javascript:>.
>> To post to this group, send email to ansible...@googlegroups.com 
>> <javascript:>.
>> 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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to