From 4148ce02a538d57640e5961a5d6a7b96a35ffab6 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 15 Apr 2018 10:14:41 -0500 Subject: [PATCH] ci: dch-gw: Switch to ansiblePlaybook steps --- ci/dch-gw.jenkinsfile | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/ci/dch-gw.jenkinsfile b/ci/dch-gw.jenkinsfile index 33e9ddc..10b2279 100644 --- a/ci/dch-gw.jenkinsfile +++ b/ci/dch-gw.jenkinsfile @@ -22,25 +22,29 @@ pipeline { stage('Services') { steps { - withCredentials([file( - credentialsId: 'ansible-vault', - variable: 'ANSIBLE_VAULT_PASSWORD_FILE')]) { - sshagent(['jenkins-ssh']) { - sh 'ansible-playbook --diff -b dhcpd.yml radvd.yml' - } - } + ansiblePlaybook \ + playbook: 'dhcpcd.yml', + become: true, + credentialsId: 'jenkins-ssh', + vaultCredentialsId: 'ansible-vault', + extras: '--diff' + ansiblePlaybook \ + playbook: 'radvd.yml', + become: true, + credentialsId: 'jenkins-ssh', + vaultCredentialsId: 'ansible-vault', + extras: '--diff' } } stage('Firewall') { steps { - withCredentials([file( - credentialsId: 'ansible-vault', - variable: 'ANSIBLE_VAULT_PASSWORD_FILE')]) { - sshagent(['jenkins-ssh']) { - sh 'ansible-playbook --diff -b dch-gw.yml' - } - } + ansiblePlaybook \ + playbook: 'dch-gw.yml', + become: true, + credentialsId: 'jenkins-ssh', + vaultCredentialsId: 'ansible-vault', + extras: '--diff' } }