49 lines
1.2 KiB
Groovy
49 lines
1.2 KiB
Groovy
// vim: set ft=groovy sw=4 ts=4 sts=4 et :
|
|
|
|
pipeline {
|
|
agent {
|
|
label 'ansible'
|
|
}
|
|
|
|
triggers {
|
|
cron 'H H * * *'
|
|
}
|
|
|
|
stages {
|
|
stage('Prepare') {
|
|
steps {
|
|
withCredentials([file(
|
|
credentialsId: 'vault-jenkins@gw0',
|
|
variable: 'SUDO_PASS_FILE')]) {
|
|
sh 'cp -f "${SUDO_PASS_FILE}" host_vars/gw0/sudo-pass'
|
|
}
|
|
}
|
|
}
|
|
|
|
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'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Firewall') {
|
|
steps {
|
|
withCredentials([file(
|
|
credentialsId: 'ansible-vault',
|
|
variable: 'ANSIBLE_VAULT_PASSWORD_FILE')]) {
|
|
sshagent(['jenkins-ssh']) {
|
|
sh 'ansible-playbook --diff -b dch-gw.yml'
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|