diff --git a/ci/zabbix.jenkinsfile b/ci/zabbix.jenkinsfile new file mode 100644 index 0000000..4ce9e46 --- /dev/null +++ b/ci/zabbix.jenkinsfile @@ -0,0 +1,43 @@ +// vim: set ft=groovy sw=4 ts=4 sts=4 et : + +pipeline { + agent { + label 'ansible' + } + + triggers { + cron 'H H * * *' + } + + stages { + stage('kinit') { + steps { + withCredentials([file( + credentialsId: 'keytab-jenkins@pyrocufflink.blue', + variable: 'KEYTAB')]) { + sh 'kinit -kt "${KEYTAB}" jenkins@PYROCUFFLINK.BLUE' + } + } + } + + stage('Zabbix') { + steps { + withCredentials([file( + credentialsId: 'vault-jenkins@pyrocufflink.blue', + variable: 'SUDO_PASS_FILE')]) { + ansiblePlaybook \ + playbook: 'zabbix.yml', + become: true, + vaultCredentialsId: 'ansible-vault', + extras: '-e@"${SUDO_PASS_FILE}" --diff' + } + } + } + } + + post { + always { + sh 'kdestroy' + } + } +}