Téléverser les fichiers vers "/"
This commit is contained in:
commit
cbd11cb6bf
31
Jenkinsfile
vendored
Normal file
31
Jenkinsfile
vendored
Normal 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
2
inventory.ini
Normal file
@ -0,0 +1,2 @@
|
||||
[debian_vms]
|
||||
debian_vm1 ansible_host=10.24.100.12
|
12
update_debian.yml
Normal file
12
update_debian.yml
Normal 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
|
Loading…
x
Reference in New Issue
Block a user