Happy to hear its working for you!

ssh-agent likely gets a little tricky when in the container. I can't speak
to a better way to do this as I havent had to overcome the
Passphrase-protected keys yet. That said, if you continue to have issues,
let me know what OS Base you are using for the containers and I could spin
up a test lab.

Kind Regards,
Robert Williams

On Mon, Jul 8, 2019 at 1:59 PM Claudio Rivas <[email protected]> wrote:

> Ok the thing now is running, seems it needs to store on a temporal
> repository, mine was pointing to /var/jenkins/.ansible, so y generated a
> ansible.cfg with this configuration on the same folder where my hosts file
> is:
>
> ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s
> control_path = /dev/shm/cp%%h-%%p-%%r
>
> So pointing the control path to /dev/shm do the work, don't forget to use
> -C on the ssh_args because it seems to use a particular compresion used for
> the ssh connection.
>
> If iI'm wrong with something any feedback is appreciated.
>
> Best regards,
>
> On Monday, July 8, 2019 at 7:40:03 AM UTC-5, Claudio Rivas wrote:
>>
>> Hi Robert, thanks for the advice and the link. I've tried the mentioned
>> method and noticed there's a directory known as "cp"on the route
>> "/var/jenkins_home/.ansible" (yes, with a dot) where a file is generated
>> while trying to connect to the remote server where generates a file named
>> "45a4bb8b49".
>> Is important to say that my working directory is
>> "/var/jenkins_home/ansible (yes without a dot)"
>>
>> So I've Changing the "ansible.cfg" file with the to add -o
>> ControlPath=/home/jenkins/.ansible/cp/ansible-ssh-%h-%p-%r
>> After that I've noticed that the file was too long so I used the
>> control_path_dir=/var/jenkins_home/.ansible/cp
>> So I've placed the configuration as -o
>> ControlPath=%(directory)s/ansible-ssh-%h-%p-% now do not recognize
>> something in the path and is returning:
>>
>> *test1 | UNREACHABLE! => {*
>>
>> *    "changed": false, *
>>
>> *    "msg": "Failed to connect to the host via ssh: percent_expand:
>> unknown key %(", *
>>
>> *    "unreachable": true*
>>
>> *}*
>>
>> All this is making me think about the ssh server side and the way it's
>> configured the ssh connection by default for ansible.
>>
>> Stay tunned,
>>
>> On Saturday, July 6, 2019 at 6:17:03 PM UTC-5, Claudio Rivas wrote:
>>>
>>> Thanks for the hint, I’ll start moving on with your suggestions. I’ll
>>> come back to documento t this and let you know.
>>
>> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/64dca2a9-04be-4d39-8b6c-49a908bf2f46%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/64dca2a9-04be-4d39-8b6c-49a908bf2f46%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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAHg2U9NCTYJvp%2B_f%3DsRoG0S4V_i5Kj1emFxVwWx-%3Dbj-%2Bm7dCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to