jenkins-update/Jenkinsfile

32 lines
641 B
Groovy

pipeline {
agent any
environment {
ANSIBLE_INVENTORY = 'inventory.ini'
ANSIBLE_PLAYBOOK = 'update_debian.yml'
}
stages {
stage('Checkout') {
steps {
git 'https://git.zestes.fr/garfi/jenkins-update.git'
}
}
stage('Run Ansible Playbook') {
steps {
script {
def ansibleCommand = "ansible-playbook -i ${ANSIBLE_INVENTORY} ${ANSIBLE_PLAYBOOK}"
sh ansibleCommand
}
}
}
}
post {
always {
cleanWs()
}
}
}