Execute ansible command remotely

This commit is contained in:
Nana Janashia
2021-04-07 11:59:04 +02:00
parent c70bfe4bbd
commit 3208a0e63e

3
Jenkinsfile vendored
View File

@@ -27,8 +27,7 @@ pipeline {
withCredentials([sshUserPrivateKey(credentialsId: 'ansible-server-key', keyFileVariable: 'keyfile', usernameVariable: 'user')]){ withCredentials([sshUserPrivateKey(credentialsId: 'ansible-server-key', keyFileVariable: 'keyfile', usernameVariable: 'user')]){
remote.user = user remote.user = user
remote.identityFile = keyfile remote.identityFile = keyfile
sshCommand remote: remote, command: "ls -l" sshCommand remote: remote, command: "ansible-playbook my-playbook.yaml"
} }
} }
} }