From 45e509506beee7a04f6392e9922e9927bf760360 Mon Sep 17 00:00:00 2001 From: Nana Janashia Date: Wed, 7 Apr 2021 12:10:30 +0200 Subject: [PATCH] Add optional step of preparing ansible server --- Jenkinsfile | 1 + prepare-ansible-server.sh | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 prepare-ansible-server.sh diff --git a/Jenkinsfile b/Jenkinsfile index ba45f7f..c54b2d2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -30,6 +30,7 @@ pipeline { withCredentials([sshUserPrivateKey(credentialsId: 'ansible-server-key', keyFileVariable: 'keyfile', usernameVariable: 'user')]){ remote.user = user remote.identityFile = keyfile + sshScript remote: remote, script: "prepare-ansible-server.sh" sshCommand remote: remote, command: "ansible-playbook my-playbook.yaml" } } diff --git a/prepare-ansible-server.sh b/prepare-ansible-server.sh new file mode 100644 index 0000000..5f59e6f --- /dev/null +++ b/prepare-ansible-server.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +apt update +apt install ansible -y +apt install python3-pip -y +pip3 install boto3 botocore \ No newline at end of file