Add optional step of preparing ansible server
This commit is contained in:
1
Jenkinsfile
vendored
1
Jenkinsfile
vendored
@@ -30,6 +30,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
|
||||||
|
sshScript remote: remote, script: "prepare-ansible-server.sh"
|
||||||
sshCommand remote: remote, command: "ansible-playbook my-playbook.yaml"
|
sshCommand remote: remote, command: "ansible-playbook my-playbook.yaml"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
6
prepare-ansible-server.sh
Normal file
6
prepare-ansible-server.sh
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
apt update
|
||||||
|
apt install ansible -y
|
||||||
|
apt install python3-pip -y
|
||||||
|
pip3 install boto3 botocore
|
||||||
Reference in New Issue
Block a user