From 9ff1b3b538b592ee8df786967365775b97d00fa4 Mon Sep 17 00:00:00 2001 From: kevin Date: Sat, 13 Jun 2015 16:34:05 -0500 Subject: [PATCH] Added apt update tasks to everything using apt This change adds a specific update task to all tasks that all the apt ansible module. This change was done to ensure that the cache is updated as expected when instructed to do so. The reason that the cache update is being removed from the grouping is because there is an upstream bug that is effecting the process by which the apt cache is updated when there is a package list to process within the same task. The work around to make this function as expected is to move the update into its own task without a package list. Upstream Ansible bug: - https://github.com/ansible/ansible-modules-core/issues/1497 Change-Id: Ic06d89a76d772c12888b4bc4bbf147be58b0c150 Related-Bug: 1464771 --- tasks/nova_compute_kvm_install.yml | 14 ++++++++++++-- tasks/nova_install.yml | 13 +++++++++++-- tasks/nova_spice_console_install.yml | 15 +++++++++++++-- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/tasks/nova_compute_kvm_install.yml b/tasks/nova_compute_kvm_install.yml index faad1687..4eba186f 100644 --- a/tasks/nova_compute_kvm_install.yml +++ b/tasks/nova_compute_kvm_install.yml @@ -13,12 +13,22 @@ # See the License for the specific language governing permissions and # limitations under the License. +- name: Update apt sources + apt: + update_cache: yes + cache_valid_time: 600 + register: apt_update + until: apt_update|success + retries: 5 + delay: 2 + tags: + - nova-apt-packages + - nova-compute-kvm-apt-packages + - name: Install apt packages apt: pkg: "{{ item }}" state: latest - update_cache: yes - cache_valid_time: 600 register: install_packages until: install_packages|success retries: 5 diff --git a/tasks/nova_install.yml b/tasks/nova_install.yml index f9452408..8ad6d936 100644 --- a/tasks/nova_install.yml +++ b/tasks/nova_install.yml @@ -13,12 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. +- name: Update apt sources + apt: + update_cache: yes + cache_valid_time: 600 + register: apt_update + until: apt_update|success + retries: 5 + delay: 2 + tags: + - nova-apt-packages + - name: Install apt packages apt: pkg: "{{ item }}" state: latest - update_cache: yes - cache_valid_time: 600 register: install_packages until: install_packages|success retries: 5 diff --git a/tasks/nova_spice_console_install.yml b/tasks/nova_spice_console_install.yml index df48523d..a810474f 100644 --- a/tasks/nova_spice_console_install.yml +++ b/tasks/nova_spice_console_install.yml @@ -13,17 +13,28 @@ # See the License for the specific language governing permissions and # limitations under the License. +- name: Update apt sources + apt: + update_cache: yes + cache_valid_time: 600 + register: apt_update + until: apt_update|success + retries: 5 + delay: 2 + tags: + - nova-apt-packages + - nova-spice-apt-packages + - name: Install apt packages apt: pkg: "{{ item }}" state: latest - update_cache: yes - cache_valid_time: 600 register: install_packages until: install_packages|success retries: 5 delay: 2 with_items: nova_spice_apt_packages tags: + - nova-apt-packages - nova-spice-apt-packages