summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/sane_debian_system/tasks/apt.yml29
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 }}"