| when i use physique private key stocked on my server the ssh connection is well done , but when i use sshagent to get the private key form the credential which have the same key (allready verified) the connection is failed. /!\ i'm using sshagent in the groovy pipeline because i need to use differents credentials : stage { steps { sshagent (credentials: ['f6cd2c20-74c6-48c1-b728-cce2b7c99687']) { dir("${PLAY_PATH}") { ansiblePlaybook( colorized: true, installation: 'ansible', playbook: 'deploy_dc.yaml', hostKeyChecking: false, extras: '-vvvv', extraVars: [ USER: "${USER_ID}", application: "${Application}" ] ) } } } } ERROR: ssh-agent] Using credentials jenkins [ssh-agent] Looking for ssh-agent implementation... [ssh-agent] Exec ssh-agent (binary ssh-agent on a remote machine) $ ssh-agent SSH_AUTH_SOCK=/tmp/ssh-YIpaWLmGXvTs/agent.96914 SSH_AGENT_PID=96918 Running ssh-add (command line suppressed) Identity added: /app/list/jenkins/workspace/VFI_SILO1_ETAT_TEST@tmp/private_key_5247074270144721685.key (/app/list/jenkins/workspace/VFI_SILO1_ETAT_TEST@tmp/private_key_5247074270144721685.key) [ssh-agent] Started. [Pipeline] { [Pipeline] dir Running in /app/list/ansible/Ansible [Pipeline] { [Pipeline] ansiblePlaybook [AnsibleCAGIP] $ ansible-playbook deploy_dc.yaml -e USER=jenkins -e application=wn --vvvv ansible-playbook 2.4.2.0 config file = /app/list/ansible/Ansible/configuration/ansible_LR023MID.cfg configured module search path = [u'/app/list/home/dcexploit/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /usr/bin/ansible-playbook python version = 2.7.5 (default, Mar 26 2019, 22:13:06) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] Using /app/list/ansible/AnsibleCAGIP/configuration/ansible_LR023MID.cfg as config file setting up inventory plugins Parsed /app/list/ansible/AnsibleCAGIP/configuration/hosts_LR023MID inventory source with ini plugin Loading callback plugin debug of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible/plugins/callback/_init_.pyc PLAYBOOK: deploy_dc.yaml ******************************************************* 1 plays in deploy_dc.yaml PLAY [wn.s1n.integration.stop] ************************************************* Read vars_file 'group_vars/all' TASK [Gathering Facts] ********************************************************* Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setup.py <10.186.xx.xx> ESTABLISH SSH CONNECTION FOR USER: jenkins <10.186.xx.xx> SSH: EXEC ssh -vvv -E /app/list/ansible/Ansible/key/log -o GSSAPIAuthentication=yes -o UserKnownHostsFile=/app/list/ansible/Ansible/configuration/known_hosts_LR023MID -o User=jenkins -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=jenkins -o ConnectTimeout=10 10.186.xx.xx '/bin/sh -c '"'"'/usr/bin/python && sleep 0'"'"'' fatal: [ANS_IAOXAS01]: UNREACHABLE! => { "changed": false, "unreachable": true } MSG: SSH Error: data could not be sent to remote host "10.186.xx.xx". Make sure this host can be reached over ssh PLAY RECAP ********************************************************************* ANS_IAOXAS01 : ok=0 changed=0 unreachable=1 failed=0 |