jenkins ssh-agent ansible

classic Classic list List threaded Threaded
4 messages Options
AC
Reply | Threaded
Open this post in threaded view
|

jenkins ssh-agent ansible

AC
Hello,

I have Ansible installed on my Jenkins master. The Jenkins Ansible plugin was working and completing jobs until I switched over to using ssh-agent to encrypt my private key. However, I can still run Ansible commands from the Jenskins Master CLI but not from the Jenkins Ansible Plugin.

Does Jenkins not run the jobs as the Jenkins user which has ssh-agent running? Does anyone know if there is a way to do this?

Thanks!

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/7b7b1903-c2a3-4173-9024-9e1ffe4530e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
AC
Reply | Threaded
Open this post in threaded view
|

Re: jenkins ssh-agent ansible

AC
I think this actually has to do with the ssh-agent not running in the same session. If this is the case is my only option to use the Jenkins ssh-agent plugin?

On Wednesday, October 26, 2016 at 2:16:37 PM UTC-4, AC wrote:
Hello,

I have Ansible installed on my Jenkins master. The Jenkins Ansible plugin was working and completing jobs until I switched over to using ssh-agent to encrypt my private key. However, I can still run Ansible commands from the Jenskins Master CLI but not from the Jenkins Ansible Plugin.

Does Jenkins not run the jobs as the Jenkins user which has ssh-agent running? Does anyone know if there is a way to do this?

Thanks!

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/945f9c00-6665-4783-a26e-d85ebf703e2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: jenkins ssh-agent ansible

jcsirot
In reply to this post by AC
Hello,

Ansible is launched as a subprocess of Jenkins server and is therefore using the same user. However I'm not really familiar with ssh-agent. I'm going to try to reproduce this issue and see if there is something I can do in the plugin code to help you.

Regards,

-- 
Jean-Christophe

Le mercredi 26 octobre 2016 20:16:37 UTC+2, AC a écrit :
Hello,

I have Ansible installed on my Jenkins master. The Jenkins Ansible plugin was working and completing jobs until I switched over to using ssh-agent to encrypt my private key. However, I can still run Ansible commands from the Jenskins Master CLI but not from the Jenkins Ansible Plugin.

Does Jenkins not run the jobs as the Jenkins user which has ssh-agent running? Does anyone know if there is a way to do this?

Thanks!

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/4491ccff-697f-4293-8ac8-a070c93ae246%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: jenkins ssh-agent ansible

Matthew Wilmott
Did anything come of the investigation Jean-Christophe?

I've got some keys I need to provide Ansible in order to jump through bastion hosts. They differ from the credentials supplied to Ansible itself (the target host credential)

I'd normally add these keys to an ssh config and be done with it but within Jenkins I need to store these in the credential store. Without knowing the credential path for prior, there is no means of adding the path to the config hence the reliance on ssh-agent 

If this could be achieved it would be excellent.

Matt

On Friday, October 28, 2016 at 4:37:22 AM UTC+9, jcsirot wrote:
Hello,

Ansible is launched as a subprocess of Jenkins server and is therefore using the same user. However I'm not really familiar with ssh-agent. I'm going to try to reproduce this issue and see if there is something I can do in the plugin code to help you.

Regards,

-- 
Jean-Christophe

Le mercredi 26 octobre 2016 20:16:37 UTC+2, AC a écrit :
Hello,

I have Ansible installed on my Jenkins master. The Jenkins Ansible plugin was working and completing jobs until I switched over to using ssh-agent to encrypt my private key. However, I can still run Ansible commands from the Jenskins Master CLI but not from the Jenkins Ansible Plugin.

Does Jenkins not run the jobs as the Jenkins user which has ssh-agent running? Does anyone know if there is a way to do this?

Thanks!

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/afc479e5-0c61-4d73-a076-c8946ada09af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.