Fix with sshagent

This commit is contained in:
Nana Janashia committed 2021-04-03 17:56:45 +02:00
1 parent f5aa1df5d3
commit 0e2f79cbcd
1 file changed
+2 -2
+2 -2
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"
} }
} }
} }