diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-08-20 11:37:00 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-08-20 11:37:00 +0300 |
commit | a24f14f5c1657489931d009b74438aa84324029c (patch) | |
tree | 3ec0071f5464448e850fe0d3e0a88e46d115e6c8 | |
parent | 5df906a4775b8addc8c00dcc0492e3507f4ab7fd (diff) | |
download | debian-ansible-a24f14f5c1657489931d009b74438aa84324029c.tar.gz |
fix: automatically handle stable becoming bullseye
Sponsored-by: author
-rw-r--r-- | roles/sane_debian_system/tasks/apt.yml | 29 |
1 files changed, 14 insertions, 15 deletions
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 }}" |