2025-05-17 21:47:25 +00:00

33 lines
681 B
Groovy

pipeline {
agent any
environment {
ANSIBLE_INVENTORY = 'inventory.ini'
ANSIBLE_PLAYBOOK = 'update_debian.yml'
}
stages {
stage('Clone git') {
steps {
sh "rm -rf *"
sh "git clone 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()
}
}
}