Make sure we have valid package caches for Debian

Be cause we don't want to manage apt or yum in our role, we need to
make sure each has a valid cache before running the role.

Currently we are only seeing this issue under Ubuntu Trusty, but we
should keep an eye out to see if it affects Centos.

Change-Id: Ib365b89284e18935389a86bb9d3904bfa3c83cc7
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2015-11-23 11:31:58 -05:00
parent 27941b8199
commit 8ed86363e3
2 changed files with 14 additions and 0 deletions

View File

@ -20,6 +20,12 @@ including Jenkins and Zuul.
Requirements
------------
Packages
~~~~~~~~
Package repository index files should be up to date before using this role, we
do not manage them.
Role Variables
--------------

View File

@ -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 }}"