commit 30ace79d734654d0a11cffaaae7a56a6c1cb6b2e Author: Ataxya Date: Mon Oct 11 21:30:52 2021 +0200 Initial commit: update&upgrade diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/files/list-bullseye.j2 b/files/list-bullseye.j2 new file mode 100644 index 0000000..72941ce --- /dev/null +++ b/files/list-bullseye.j2 @@ -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 diff --git a/files/list-bullseye.j2~ b/files/list-bullseye.j2~ new file mode 100644 index 0000000..8da549a --- /dev/null +++ b/files/list-bullseye.j2~ @@ -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 \ No newline at end of file diff --git a/inventory b/inventory new file mode 100644 index 0000000..9947ec0 --- /dev/null +++ b/inventory @@ -0,0 +1,3 @@ +[all] + +10.20.1.101 ansible_user=root #website \ No newline at end of file diff --git a/playbook/update.yml b/playbook/update.yml new file mode 100644 index 0000000..6b3b150 --- /dev/null +++ b/playbook/update.yml @@ -0,0 +1,6 @@ +- hosts: all + tasks: + - name: update a server + apt: update_cache=yes + - name: upgrade a server + apt: upgrade diff --git a/playbook/update.yml~ b/playbook/update.yml~ new file mode 100644 index 0000000..5bb1f2c --- /dev/null +++ b/playbook/update.yml~ @@ -0,0 +1,6 @@ +- hosts: all + tasks: + - name: update a server + apt: update_cache=yes + - name: upgrade a server + apt: upgrade=dist diff --git a/playbook/upgrade.yml b/playbook/upgrade.yml new file mode 100644 index 0000000..c0aa020 --- /dev/null +++ b/playbook/upgrade.yml @@ -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 !" diff --git a/playbook/upgrade.yml~ b/playbook/upgrade.yml~ new file mode 100644 index 0000000..d81b46e --- /dev/null +++ b/playbook/upgrade.yml~ @@ -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