Suddenly my sshagent step in jenkins pipeline is not working and throwing below error
But same step with same creds is working fine on master and other slave agents.Also able to see ssh-agent is running on the slave node
$ ps -ef|grep -i ssh-agent
root 8548 1 0 11:40 ? 00:00:00 ssh-agent -s
root 9622 1 0 12:29 ? 00:00:00 ssh-agent -s
stage which failing
stage('Pull ansible roles') {
steps {
sshagent(credentials:[XX_XX_KEY_ID]){
sh '''
ansible-galaxy install -r requirements.yml -p roles
'''
}
}
}
Could you please guide me what may be the issue
I have found the issue is with /tmp permission. Jenkins slave user unable to execute ssh-agent command
[devops@01 ~]$ ssh-agent
mkdtemp: private socket dir: Permission denied
[devops@01 ~]$ sudo chmod 1777 /tmp
[devops@01 ~]$ ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-B3lS2R3p2bpT/agent.10399; export SSH_AUTH_SOCK;
SSH_AGENT_PID=10400; export SSH_AGENT_PID;
echo Agent pid 10400;
[devops@01 ~]$
Reference - https://github.com/babun/babun/issues/815
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.