From: Andrew Schoen Date: Tue, 8 Sep 2015 14:47:30 +0000 (-0500) Subject: testnode: always update the apt cache X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=85183c7ecf1e139e330461058f73bc02f52cf1af;p=ceph-cm-ansible.git testnode: always update the apt cache 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 --- diff --git a/roles/testnode/tasks/apt/repos.yml b/roles/testnode/tasks/apt/repos.yml index f8a9ce4..01f75e7 100644 --- a/roles/testnode/tasks/apt/repos.yml +++ b/roles/testnode/tasks/apt/repos.yml @@ -52,16 +52,3 @@ 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 diff --git a/roles/testnode/tasks/apt_systems.yml b/roles/testnode/tasks/apt_systems.yml index b32bbce..36c101e 100644 --- a/roles/testnode/tasks/apt_systems.yml +++ b/roles/testnode/tasks/apt_systems.yml @@ -10,10 +10,12 @@ - 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