Téléverser les fichiers vers "/"

This commit is contained in:
garfi 2025-04-15 22:49:09 +00:00
commit cbd11cb6bf
3 changed files with 45 additions and 0 deletions

31
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,31 @@
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()
}
}
}

2
inventory.ini Normal file
View File

@ -0,0 +1,2 @@
[debian_vms]
debian_vm1 ansible_host=10.24.100.12

12
update_debian.yml Normal file
View File

@ -0,0 +1,12 @@
---
- name: Update Debian VMs
hosts: debian_vms
become: yes
tasks:
- name: Update apt cache
apt:
update_cache: yes
- name: Upgrade all packages to the latest version
apt:
upgrade: dist