diff options
author | Ivan Dolgov <ivan@dolgov.fi> | 2018-02-26 09:23:55 +0200 |
---|---|---|
committer | Ivan Dolgov <ivan@dolgov.fi> | 2018-02-26 09:23:55 +0200 |
commit | 9443898ed15a4fa7b8d2712a073b1bd2b011fa0a (patch) | |
tree | 063ffc5e6ddf80531b50e1f8108f3b68962537f4 | |
parent | e482b627d056986229a87bc18358a7240e6819b6 (diff) | |
parent | 1472f5299393950a66b942bb735388a0b0186edb (diff) | |
download | debian-ansible-9443898ed15a4fa7b8d2712a073b1bd2b011fa0a.tar.gz |
Merge branch 'liw/sane'
-rw-r--r-- | roles/sane_debian_system/defaults/main.yml | 2 | ||||
-rw-r--r-- | roles/sane_debian_system/tasks/apt.yml | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/roles/sane_debian_system/defaults/main.yml b/roles/sane_debian_system/defaults/main.yml index aa5d7cb..9920f83 100644 --- a/roles/sane_debian_system/defaults/main.yml +++ b/roles/sane_debian_system/defaults/main.yml @@ -5,7 +5,7 @@ hostname: "" # The Debian release code name to use. -debian_codename: YOUMUSTSETTHIS +debian_codename: # Default Debian mirror to use. Default should work everywhere, but if # needed, pick a faster mirror, perhaps a local one. diff --git a/roles/sane_debian_system/tasks/apt.yml b/roles/sane_debian_system/tasks/apt.yml index 3479334..84c6420 100644 --- a/roles/sane_debian_system/tasks/apt.yml +++ b/roles/sane_debian_system/tasks/apt.yml @@ -1,6 +1,20 @@ +# Safety check: make sure debian_codename is set. +- name: check that debian_codename is set + shell: | + if [ "{{ debian_codename }}" = "" ] + then + echo "You MUST set debian_codename" 1>&2 + exit 1 + fi + + # 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. - name: update package lists + ignore_errors: yes apt: update_cache: yes cache_valid_time: 0 @@ -10,7 +24,11 @@ # 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 |