diff --git a/ci/pyrocufflink.jenkinsfile b/ci/pyrocufflink.jenkinsfile index 59e9cb0..6032cbe 100644 --- a/ci/pyrocufflink.jenkinsfile +++ b/ci/pyrocufflink.jenkinsfile @@ -22,19 +22,14 @@ pipeline { stage('Domain Member') { steps { - withCredentials([ - file( - credentialsId: 'ansible-vault', - variable: 'ANSIBLE_VAULT_PASSWORD_FILE', - ), - file( - credentialsId: 'vault-jenkins@pyrocufflink.blue', - variable: 'SUDO_PASS_FILE', - ), - ]) { - sh ''' -ansible-playbook --diff -b pyrocufflink.yml -e "@${SUDO_PASS_FILE}" -''' + withCredentials([file( + credentialsId: 'vault-jenkins@pyrocufflink.blue', + variable: 'SUDO_PASS_FILE')]) { + ansiblePlaybook \ + playbook: 'pyrocufflink.yml', + become: true, + vaultCredentialsId: 'ansible-vault', + extras: '-e@"${SUDO_PASS_FILE}" --diff' } } }