Execute ansible command remotely
This commit is contained in:
3
Jenkinsfile
vendored
3
Jenkinsfile
vendored
@@ -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"
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user