From 49cc40e756ad65f3abc5652299a1089a5a880754 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Wed, 16 Jun 2021 13:34:39 +0100 Subject: [PATCH] Handle sources.list for Debian 10 and 11 --- roles/debian/files/sources.list.10 | 8 ++++++++ roles/debian/files/sources.list.11 | 8 ++++++++ roles/debian/tasks/apt-sources.yml | 13 ++++++++++--- roles/debian/tasks/main.yml | 3 +-- roles/debian/templates/sources.list | 8 -------- 5 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 roles/debian/files/sources.list.10 create mode 100644 roles/debian/files/sources.list.11 delete mode 100644 roles/debian/templates/sources.list diff --git a/roles/debian/files/sources.list.10 b/roles/debian/files/sources.list.10 new file mode 100644 index 0000000..1c84348 --- /dev/null +++ b/roles/debian/files/sources.list.10 @@ -0,0 +1,8 @@ +deb http://deb.debian.org/debian/ buster main non-free contrib +deb-src http://deb.debian.org/debian/ buster main non-free contrib + +deb http://deb.debian.org/debian/ buster-updates main non-free contrib +deb-src http://deb.debian.org/debian/ buster-updates main non-free contrib + +deb http://deb.debian.org/debian-security/ buster/updates main non-free contrib +deb-src http://deb.debian.org/debian-security/ buster/updates main non-free contrib diff --git a/roles/debian/files/sources.list.11 b/roles/debian/files/sources.list.11 new file mode 100644 index 0000000..c253722 --- /dev/null +++ b/roles/debian/files/sources.list.11 @@ -0,0 +1,8 @@ +deb http://deb.debian.org/debian/ bullseye main non-free contrib +deb-src http://deb.debian.org/debian/ bullseye main non-free contrib + +deb http://deb.debian.org/debian/ bullseye-updates main non-free contrib +deb-src http://deb.debian.org/debian/ bullseye-updates main non-free contrib + +deb http://deb.debian.org/debian-security/ bullseye-security main non-free contrib +deb-src http://deb.debian.org/debian-security/ bullseye-security main non-free contrib diff --git a/roles/debian/tasks/apt-sources.yml b/roles/debian/tasks/apt-sources.yml index 9671d35..42745ae 100644 --- a/roles/debian/tasks/apt-sources.yml +++ b/roles/debian/tasks/apt-sources.yml @@ -13,11 +13,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Set APT sources.list +- name: Set APT sources.list for Debian 10 become: true - ansible.builtin.template: - src: sources.list + ansible.builtin.copy: + src: sources.list.10 dest: "/etc/apt/sources.list" + when: ansible_distribution_version == "10" +- name: Set APT sources.list for Debian 11 + become: true + ansible.builtin.copy: + src: sources.list.11 + dest: "/etc/apt/sources.list" + when: ansible_distribution_version == "11" - name: Update APT cache become: true ansible.builtin.apt: diff --git a/roles/debian/tasks/main.yml b/roles/debian/tasks/main.yml index 9e18a20..36d601e 100644 --- a/roles/debian/tasks/main.yml +++ b/roles/debian/tasks/main.yml @@ -13,8 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# apt-sources.yml is disabled until Debian bullseye is released. -#- include: apt-sources.yml +- include: apt-sources.yml - include: packages-cli.yml - include: packages-gui.yml when: gui == true diff --git a/roles/debian/templates/sources.list b/roles/debian/templates/sources.list deleted file mode 100644 index 7c52a91..0000000 --- a/roles/debian/templates/sources.list +++ /dev/null @@ -1,8 +0,0 @@ -deb http://deb.debian.org/debian/ {{ ansible_distribution_release }} main non-free contrib -deb-src http://deb.debian.org/debian/ {{ ansible_distribution_release }} main non-free contrib - -deb http://deb.debian.org/debian/ {{ ansible_distribution_release }}-updates main non-free contrib -deb-src http://deb.debian.org/debian/ {{ ansible_distribution_release }}-updates main non-free contrib - -deb http://deb.debian.org/debian-security/ {{ ansible_distribution_release }}-security main non-free contrib -deb-src http://deb.debian.org/debian-security/ {{ ansible_distribution_release }}-security main non-free contrib