Fix with sshagent
This commit is contained in:
@@ -8,8 +8,8 @@ pipeline {
|
||||
steps {
|
||||
script {
|
||||
echo "copying ansible folder to ansible server"
|
||||
withCredentials([sshUserPrivateKey(credentialsId: 'ansible-server-key', keyFileVariable: 'identity', usernameVariable: 'user')]) {
|
||||
sh "scp -i ${identity} ansible/ansible.cfg ${ANSIBLE_SERVER}:/root"
|
||||
sshagent(['ansible-server-key']) {
|
||||
sh "scp ansible/ansible.cfg ${ANSIBLE_SERVER}:/root"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user