From bbbb0f05422320cbe4b7622c34d2d7ea776f4053 Mon Sep 17 00:00:00 2001 From: eoli3n Date: Mon, 2 Dec 2019 14:31:23 +0100 Subject: [PATCH] toolbox buster upgrade role --- install.yml | 7 +++++++ roles/buster_upgrade/files/sources.list | 9 +++++++++ roles/buster_upgrade/tasks/main.yml | 23 +++++++++++++++++++++++ toolbox/README | 4 ++++ 4 files changed, 43 insertions(+) create mode 100644 roles/buster_upgrade/files/sources.list create mode 100644 roles/buster_upgrade/tasks/main.yml create mode 100644 toolbox/README diff --git a/install.yml b/install.yml index d988785..b68bb41 100644 --- a/install.yml +++ b/install.yml @@ -27,6 +27,13 @@ msg: "Don't run as root." when: ansible_user_id == "root" +- hosts: server:desktop:laptop + tasks: + - name: update package list if apt + apt: + update_cache: yes + when: ansible_distribution == "Debian" + - hosts: server:desktop:laptop roles: - { role: packages-common, tags: packages-common } diff --git a/roles/buster_upgrade/files/sources.list b/roles/buster_upgrade/files/sources.list new file mode 100644 index 0000000..f3728a2 --- /dev/null +++ b/roles/buster_upgrade/files/sources.list @@ -0,0 +1,9 @@ +deb http://ftp.fr.debian.org/debian/ buster main +deb-src http://ftp.fr.debian.org/debian/ buster main + +deb http://security.debian.org/debian-security buster/updates main +deb-src http://security.debian.org/debian-security buster/updates main + +# buster-updates, previously known as 'volatile' +deb http://ftp.fr.debian.org/debian/ buster-updates main +deb-src http://ftp.fr.debian.org/debian/ buster-updates main diff --git a/roles/buster_upgrade/tasks/main.yml b/roles/buster_upgrade/tasks/main.yml new file mode 100644 index 0000000..15a2880 --- /dev/null +++ b/roles/buster_upgrade/tasks/main.yml @@ -0,0 +1,23 @@ +--- +- name: Gather facts + gather_facts: + +- name: Upgrade to Debian 10 + block: + - name: Install https source support + apt: + name: + - apt-transport-https + - ca-certificates + - name: Define apt sources to buster + copy: + src: sources.list + dest: /etc/apt/ + - name: Apt update and upgrade + apt: + update_cache: yes + upgrade: yes + - name: Apt dist upgrade + apt: + upgrade: dist + when: ansible_distribution_release == 'stretch' diff --git a/toolbox/README b/toolbox/README new file mode 100644 index 0000000..39373f1 --- /dev/null +++ b/toolbox/README @@ -0,0 +1,4 @@ +# upgrade to debian buster +``` +ansible -m include_role -a 'name=buster_upgrade' +```