From a24f14f5c1657489931d009b74438aa84324029c Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 20 Aug 2021 11:37:00 +0300 Subject: fix: automatically handle stable becoming bullseye Sponsored-by: author --- roles/sane_debian_system/tasks/apt.yml | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'roles') diff --git a/roles/sane_debian_system/tasks/apt.yml b/roles/sane_debian_system/tasks/apt.yml index d27083e..5beced5 100644 --- a/roles/sane_debian_system/tasks/apt.yml +++ b/roles/sane_debian_system/tasks/apt.yml @@ -11,28 +11,24 @@ # First update package lists. The ones that come with the image may be # badly out of date. # -# Ignore any error here so that later tasks can fix things such as a badly -# formed sources.list. +# Use shell to run apt-get, rather than the Ansible apt module, so +# that we can pass in the --allow-releaseinfo--change option. +- name: update package lists + shell: | + apt-get update --allow-releaseinfo-change + - name: update package lists ignore_errors: yes apt: update_cache: yes cache_valid_time: 0 -- name: install sudo - apt: - name: sudo - # Now install https transport for APT. This is installed before # changing sources lists, so that if they happen to use https URLs apt # will still work. apt-transport-https is in the main Debian archive, # and we assume those are in the sources.list that come with the # image. -# -# Ignore any error here so that later tasks can fix things such as a badly -# formed sources.list. - name: install apt-transport-https - ignore_errors: yes apt: name: apt-transport-https @@ -47,9 +43,11 @@ repo: "{{ item.repo }}" update_cache: no -- name: install gnupg +- name: install gnupg and sudo apt: - name: gnupg + name: + - gnupg + - sudo - name: add archive signing keys with_items: "{{ sane_debian_system_sources_lists }}" @@ -58,10 +56,11 @@ state: present when: item.signing_key is defined +# Use shell to run apt-get to update package lists so that we can pass +# in the --allow-releaseinfo--change option. - name: update package lists - apt: - update_cache: yes - cache_valid_time: 0 + shell: | + apt-get update --allow-releaseinfo-change - name: add archive keyrings with_items: "{{ sane_debian_system_sources_lists }}" -- cgit v1.2.1