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