From e8d670c2bf70955741b26d02309f8affe9a6351c Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 15 Apr 2018 10:15:49 -0500 Subject: [PATCH] ci: samba-dc: Switch to ansiblePlaybook steps --- ci/samba-dc.jenkinsfile | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/ci/samba-dc.jenkinsfile b/ci/samba-dc.jenkinsfile index f98f12f..9d9d143 100644 --- a/ci/samba-dc.jenkinsfile +++ b/ci/samba-dc.jenkinsfile @@ -22,19 +22,14 @@ pipeline { stage('Domain Controller') { steps { - withCredentials([ - file( - credentialsId: 'ansible-vault', - variable: 'ANSIBLE_VAULT_PASSWORD_FILE', - ), - file( - credentialsId: 'vault-jenkins@pyrocufflink.blue', - variable: 'SUDO_PASS_FILE', - ), - ]) { - sh ''' -ansible-playbook --check --diff -b domain-controller.yml -e "@${SUDO_PASS_FILE}" -''' + withCredentials([file( + credentialsId: 'vault-jenkins@pyrocufflink.blue', + variable: 'SUDO_PASS_FILE')]) { + ansiblePlaybook \ + playbook: 'domain-controller.yml', + become: true, + vaultCredentialsId: 'ansible-vault', + extras: '-e@"${SUDO_PASS_FILE}" --diff' } } }