From 0a733422c7a2e2d0a836df3db30f9714406196e4 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Tue, 24 Nov 2015 14:23:42 -0500 Subject: [PATCH] Refactor test.yaml Fix some common issues we have testing a role in the gate. Change-Id: If376cc37be161ce37d0e42b0957e5c9a7f9aa843 Signed-off-by: Paul Belanger --- tests/test.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test.yaml b/tests/test.yaml index 81dab81..5fa16b8 100644 --- a/tests/test.yaml +++ b/tests/test.yaml @@ -13,7 +13,15 @@ # under the License. --- - hosts: localhost + sudo: yes vars: rolename: "{{ lookup('pipe', 'pwd') | dirname | basename }}" + pre_tasks: + # Make sure OS does not have a stale package cache. + - name: Update apt cache. + apt: + update_cache: yes + when: ansible_os_family == 'Debian' + roles: - "{{ rolename }}"