From b707e133339983d838eb59dbc624e18a22976ad7 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Fri, 13 Feb 2015 16:13:57 +0000 Subject: [PATCH] Update apt cache after adding repos or pinning This patch implements a forced apt cache update after a new apt repository is added, or any apt pinning is implemented. This ensures that apt is sure about what packages are available to it, and which packages/repositories should be preferred above others. Change-Id: I2f6e9fa33c7765e8ed8aeaf4ea60be696125c186 Closes-Bug: #1421679 --- rpc_deployment/roles/common/tasks/apt_pinning.yml | 4 ++++ rpc_deployment/roles/common/tasks/repos.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/rpc_deployment/roles/common/tasks/apt_pinning.yml b/rpc_deployment/roles/common/tasks/apt_pinning.yml index f04ea1bd4d..f407d130f5 100644 --- a/rpc_deployment/roles/common/tasks/apt_pinning.yml +++ b/rpc_deployment/roles/common/tasks/apt_pinning.yml @@ -18,3 +18,7 @@ src: apt_pinned_packages.j2 dest: /etc/apt/preferences.d/openstack_pinned_packages.pref when: apt_pinned_packages is defined + +- name: Update apt cache + apt: + update_cache: yes diff --git a/rpc_deployment/roles/common/tasks/repos.yml b/rpc_deployment/roles/common/tasks/repos.yml index 0f71302c48..3064e1815a 100644 --- a/rpc_deployment/roles/common/tasks/repos.yml +++ b/rpc_deployment/roles/common/tasks/repos.yml @@ -39,6 +39,10 @@ group: "root" mode: "0644" +- name: Update apt cache + apt: + update_cache: yes + - name: Ensure common Packages are Installed apt: pkg: "{{ item }}"