Updating the apt cache is an idempotent task so I see no problem with
always doing this. Also, debian jessie and ubuntu vivid aren't using the
local apt repos, but still need the apt cache updated.
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
mode: 0644
with_items: apt_repos|list + common_apt_repos|list
register: local_apt_repos
-
-- name: Update apt cache.
- apt:
- update_cache: yes
- when: sources|changed or
- local_apt_repos|changed or
- apt_prefs|changed
- # Register and retry to work around transient http issues
- register: apt_cache_update
- until: apt_cache_update|success
- # try for 2 minutes before failing
- retries: 24
- delay: 5
- name: Update apt cache.
apt:
update_cache: yes
- when: ansible_distribution_major_version|int >= 15 and
- ansible_distribution == "Ubuntu"
+ # try for 2 minutes before failing
+ retries: 24
+ delay: 5
tags:
- repos
+ - packages
- name: Perform package related tasks.
include: apt/packages.yml