Initial commit: update&upgrade

This commit is contained in:
Ataxya 2021-10-11 21:30:52 +02:00
commit 30ace79d73
8 changed files with 55 additions and 0 deletions

0
README.md Normal file
View File

5
files/list-bullseye.j2 Normal file
View File

@ -0,0 +1,5 @@
deb http://deb.debian.org/debian/ bullseye main contrib non-free
deb http://deb.debian.org/debian/ bullseye-updates main contrib non-free
deb http://deb.debian.org/debian bullseye-proposed-updates main contrib non-free
deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb http://deb.debian.org/debian/ bullseye-backports main contrib non-free

5
files/list-bullseye.j2~ Normal file
View File

@ -0,0 +1,5 @@
deb http://deb.debian.org/debian/ bullseye main contrib non-free
deb http://deb.debian.org/debian/ bullseye-updates main contrib non-free
deb http://deb.debian.org/debian bullseye-proposed-updates main contrib non-free
deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb http://deb.debian.org/debian/ bullseye-backports main contrib non-free

3
inventory Normal file
View File

@ -0,0 +1,3 @@
[all]
10.20.1.101 ansible_user=root #website

6
playbook/update.yml Normal file
View File

@ -0,0 +1,6 @@
- hosts: all
tasks:
- name: update a server
apt: update_cache=yes
- name: upgrade a server
apt: upgrade

6
playbook/update.yml~ Normal file
View File

@ -0,0 +1,6 @@
- hosts: all
tasks:
- name: update a server
apt: update_cache=yes
- name: upgrade a server
apt: upgrade=dist

17
playbook/upgrade.yml Normal file
View File

@ -0,0 +1,17 @@
---
- hosts: all
tasks:
- name: Change /etc/apt/sources.list
template:
src: /home/ansible/ansible/files/list-bullseye.j2
dest: /etc/apt/sources.list
- name: Updating apt cache
apt: update_cache=yes
- name: Lauch upgrade
apt: upgrade=dist
- name: Reboot
reboot:
msg: "Attention au reboot !"

13
playbook/upgrade.yml~ Normal file
View File

@ -0,0 +1,13 @@
---
- hosts: all
tasks:
- name: Change /etc/apt/sources.list
template:
src: /home/ansible/ansible/files/list-bullseye.j2
dest: /etc/apt/sources.list
- name: Updating apt cache
apt: update_cache=yes
- name: Lauch upgrade
apt: upgrade=dist