2025-06-06 21:13:25 +00:00

41 lines
1.1 KiB
Groovy

pipeline {
agent any
environment {
ANSIBLE_INVENTORY = 'jenkins-update/inventory.ini'
ANSIBLE_INVENTORY_REBOOT = 'jenkins-update/inventory_reboot.ini'
ANSIBLE_PLAYBOOK = 'jenkins-update/update_debian.yml'
ANSIBLE_PLAYBOOK_REBOOT = 'jenkins-update/reboot_backup.yml'
}
stages {
stage('Clone git') {
steps {
// Clonage du dépôt Git
sh "git clone https://git.zestes.fr/jules/jenkins-update.git"
}
}
stage('Mise à jour des machines Debian') {
steps {
// Construction et exécution de la commande Ansible
sh "ansible-playbook -i ${ANSIBLE_INVENTORY} ${ANSIBLE_PLAYBOOK}"
}
}
stage('Reboot PVE BACKUP') {
steps {
// Construction et exécution de la commande Ansible
sh "ansible-playbook -i ${ANSIBLE_INVENTORY_REBOOT} ${ANSIBLE_PLAYBOOK_REBOOT}"
}
}
}
post {
always {
// Nettoyage de l'espace de travail
cleanWs()
}
}
}