Fix with sshagent

This commit is contained in:
Nana Janashia
2021-04-03 17:56:45 +02:00
parent f5aa1df5d3
commit 0e2f79cbcd

View File

@@ -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"
} }
} }
} }