Add remote execution

This commit is contained in:
Nana Janashia
2021-04-07 11:57:06 +02:00
parent 2b7f3b1471
commit c70bfe4bbd

18
Jenkinsfile vendored
View File

@@ -15,5 +15,23 @@ pipeline {
} }
} }
} }
stage("execute ansible playbook") {
steps {
script {
echo "calling ansible playbook to configure ec2 instances"
def remote = [:]
remote.name = "ansible-server"
remote.host = "167.99.136.157"
remote.allowAnyHosts = true
withCredentials([sshUserPrivateKey(credentialsId: 'ansible-server-key', keyFileVariable: 'keyfile', usernameVariable: 'user')]){
remote.user = user
remote.identityFile = keyfile
sshCommand remote: remote, command: "ls -l"
}
}
}
}
} }
} }