summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-04-04 18:34:40 +0300
committerLars Wirzenius <liw@liw.fi>2017-04-04 18:34:40 +0300
commit39e48621be51ac5a7173860c1985b40c74780279 (patch)
treefc8acfc6186f50b3c09c268d85f3e6010f412f15 /roles
parentc709f25dd509af3f51e66725f6e0e2d0247ec292 (diff)
downloaddebian-ansible-39e48621be51ac5a7173860c1985b40c74780279.tar.gz
Fix apt-transport-https installation
We run virtual machines built from a disk image. The image has package lists downloaded, but from far ago. So we update them before installing the https transport. Then we install the transport. Then we fiddle with sources.lists, update package lists and then continue as needed.
Diffstat (limited to 'roles')
-rw-r--r--roles/sane_debian_system/tasks/apt.yml14
1 files changed, 12 insertions, 2 deletions
diff --git a/roles/sane_debian_system/tasks/apt.yml b/roles/sane_debian_system/tasks/apt.yml
index 8d57292..d6ef838 100644
--- a/roles/sane_debian_system/tasks/apt.yml
+++ b/roles/sane_debian_system/tasks/apt.yml
@@ -1,5 +1,15 @@
-# This is installed before updating sources lists, so that if they
-# happen to use https URLs the package lists can still be update.
+# First update package lists. The ones that come with the image may be
+# badly out of date.
+- name: update package lists
+ apt:
+ update_cache: yes
+ cache_valid_time: 0
+
+# 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.
- name: install apt-transport-https
apt:
name: apt-transport-https