From 59381b51ffb83bd67e13d5f04ff731f1b70a67bf 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 --- .../galera_client/tasks/galera_client_install.yml | 13 +++++++++++-- .../roles/galera_server/tasks/galera_install.yml | 13 +++++++++++-- .../galera_server/tasks/galera_pre_install.yml | 13 +++++++++++-- .../haproxy_server/tasks/haproxy_install.yml | 13 +++++++++++-- playbooks/roles/lxc_hosts/tasks/lxc_install.yml | 15 ++++++++++++--- .../memcached_server/tasks/memcached_install.yml | 13 +++++++++++-- .../tasks/openstack_host_packages.yml | 15 ++++++++++++--- .../roles/os_cinder/tasks/cinder_install.yml | 13 +++++++++++-- .../roles/os_glance/tasks/glance_install.yml | 13 +++++++++++-- playbooks/roles/os_heat/tasks/heat_install.yml | 13 +++++++++++-- .../roles/os_horizon/tasks/horizon_install.yml | 13 +++++++++++-- .../roles/os_keystone/tasks/keystone_install.yml | 13 +++++++++++-- .../roles/os_neutron/tasks/neutron_install.yml | 13 +++++++++++-- .../os_nova/tasks/nova_compute_kvm_install.yml | 14 ++++++++++++-- playbooks/roles/os_nova/tasks/nova_install.yml | 13 +++++++++++-- .../os_nova/tasks/nova_spice_console_install.yml | 15 +++++++++++++-- playbooks/roles/os_swift/tasks/swift_install.yml | 13 +++++++++++-- .../rabbitmq_server/tasks/rabbitmq_install.yml | 13 +++++++++++-- .../roles/repo_server/tasks/repo_install.yml | 12 +++++++++++- .../tasks/rsyslog_client_install.yml | 13 +++++++++++-- .../tasks/rsyslog_server_install.yml | 13 +++++++++++-- playbooks/utility-install.yml | 12 ++++++++++-- 22 files changed, 246 insertions(+), 45 deletions(-) diff --git a/playbooks/roles/galera_client/tasks/galera_client_install.yml b/playbooks/roles/galera_client/tasks/galera_client_install.yml index 5de737faf5..434c2175f6 100644 --- a/playbooks/roles/galera_client/tasks/galera_client_install.yml +++ b/playbooks/roles/galera_client/tasks/galera_client_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: + - galera-client-apt-packages + - name: Install galera 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/playbooks/roles/galera_server/tasks/galera_install.yml b/playbooks/roles/galera_server/tasks/galera_install.yml index e713659ba9..624893ceae 100644 --- a/playbooks/roles/galera_server/tasks/galera_install.yml +++ b/playbooks/roles/galera_server/tasks/galera_install.yml @@ -23,12 +23,21 @@ tags: - galera-debconf +- name: Update apt sources + apt: + update_cache: yes + cache_valid_time: 600 + register: apt_update + until: apt_update|success + retries: 5 + delay: 2 + tags: + - galera-apt-packages + - name: Install galera 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/playbooks/roles/galera_server/tasks/galera_pre_install.yml b/playbooks/roles/galera_server/tasks/galera_pre_install.yml index 2d816d90d2..7c09058229 100644 --- a/playbooks/roles/galera_server/tasks/galera_pre_install.yml +++ b/playbooks/roles/galera_server/tasks/galera_pre_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: + - galera-apt-packages + - name: Install galera pre 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/playbooks/roles/haproxy_server/tasks/haproxy_install.yml b/playbooks/roles/haproxy_server/tasks/haproxy_install.yml index d6bc937003..b97454ec93 100644 --- a/playbooks/roles/haproxy_server/tasks/haproxy_install.yml +++ b/playbooks/roles/haproxy_server/tasks/haproxy_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: + - haproxy-apt-packages + - name: Install HAPRoxy Packages apt: pkg: "{{ item }}" state: present - update_cache: yes - cache_valid_time: 600 register: install_packages until: install_packages|success retries: 5 diff --git a/playbooks/roles/lxc_hosts/tasks/lxc_install.yml b/playbooks/roles/lxc_hosts/tasks/lxc_install.yml index 5e44c9499e..04d5ea9d13 100644 --- a/playbooks/roles/lxc_hosts/tasks/lxc_install.yml +++ b/playbooks/roles/lxc_hosts/tasks/lxc_install.yml @@ -13,19 +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: + - lxc-apt-packages + - name: Install apt packages apt: pkg: "{{ item }}" state: present - update_cache: yes - cache_valid_time: 600 register: install_packages until: install_packages|success retries: 5 delay: 2 with_items: lxc_apt_packages tags: - - lxc-packages + - lxc-apt-packages # The functionality with changing the container cache has been added into the # upstream LXC templates with patch [ https://github.com/lxc/lxc/pull/558 ] diff --git a/playbooks/roles/memcached_server/tasks/memcached_install.yml b/playbooks/roles/memcached_server/tasks/memcached_install.yml index 8b9f9e253a..2623dc73cf 100644 --- a/playbooks/roles/memcached_server/tasks/memcached_install.yml +++ b/playbooks/roles/memcached_server/tasks/memcached_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: + - memcached-apt-packages + - name: Install apt packages apt: pkg: "{{ item }}" state: present - update_cache: yes - cache_valid_time: 600 register: install_packages until: install_packages|success retries: 5 diff --git a/playbooks/roles/openstack_hosts/tasks/openstack_host_packages.yml b/playbooks/roles/openstack_hosts/tasks/openstack_host_packages.yml index 884df426db..25765b9462 100644 --- a/playbooks/roles/openstack_hosts/tasks/openstack_host_packages.yml +++ b/playbooks/roles/openstack_hosts/tasks/openstack_host_packages.yml @@ -13,16 +13,25 @@ # 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: + - openstack-apt-packages + - name: Install host packages apt: pkg: "{{ item }}" state: present - update_cache: yes - cache_valid_time: 600 register: install_packages until: install_packages|success retries: 5 delay: 2 with_items: openstack_host_apt_packages tags: - - openstack-host-packages + - openstack-apt-packages diff --git a/playbooks/roles/os_cinder/tasks/cinder_install.yml b/playbooks/roles/os_cinder/tasks/cinder_install.yml index 1f15dae11a..7b789ffd1d 100644 --- a/playbooks/roles/os_cinder/tasks/cinder_install.yml +++ b/playbooks/roles/os_cinder/tasks/cinder_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: + - cinder-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/playbooks/roles/os_glance/tasks/glance_install.yml b/playbooks/roles/os_glance/tasks/glance_install.yml index dc007e0600..4af2e9ff7a 100644 --- a/playbooks/roles/os_glance/tasks/glance_install.yml +++ b/playbooks/roles/os_glance/tasks/glance_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: + - glance-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/playbooks/roles/os_heat/tasks/heat_install.yml b/playbooks/roles/os_heat/tasks/heat_install.yml index 99f6f4ca17..5a6e8a3e05 100644 --- a/playbooks/roles/os_heat/tasks/heat_install.yml +++ b/playbooks/roles/os_heat/tasks/heat_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: + - heat-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/playbooks/roles/os_horizon/tasks/horizon_install.yml b/playbooks/roles/os_horizon/tasks/horizon_install.yml index e760d56576..002eafd3c3 100644 --- a/playbooks/roles/os_horizon/tasks/horizon_install.yml +++ b/playbooks/roles/os_horizon/tasks/horizon_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: + - horizon-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/playbooks/roles/os_keystone/tasks/keystone_install.yml b/playbooks/roles/os_keystone/tasks/keystone_install.yml index 69c9b5a55b..8fd6414606 100644 --- a/playbooks/roles/os_keystone/tasks/keystone_install.yml +++ b/playbooks/roles/os_keystone/tasks/keystone_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: + - keystone-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/playbooks/roles/os_neutron/tasks/neutron_install.yml b/playbooks/roles/os_neutron/tasks/neutron_install.yml index 2211335aaf..b80e023374 100644 --- a/playbooks/roles/os_neutron/tasks/neutron_install.yml +++ b/playbooks/roles/os_neutron/tasks/neutron_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: + - neutron-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/playbooks/roles/os_nova/tasks/nova_compute_kvm_install.yml b/playbooks/roles/os_nova/tasks/nova_compute_kvm_install.yml index faad1687f0..4eba186fe9 100644 --- a/playbooks/roles/os_nova/tasks/nova_compute_kvm_install.yml +++ b/playbooks/roles/os_nova/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/playbooks/roles/os_nova/tasks/nova_install.yml b/playbooks/roles/os_nova/tasks/nova_install.yml index f9452408be..8ad6d93689 100644 --- a/playbooks/roles/os_nova/tasks/nova_install.yml +++ b/playbooks/roles/os_nova/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/playbooks/roles/os_nova/tasks/nova_spice_console_install.yml b/playbooks/roles/os_nova/tasks/nova_spice_console_install.yml index df48523d58..a810474f3c 100644 --- a/playbooks/roles/os_nova/tasks/nova_spice_console_install.yml +++ b/playbooks/roles/os_nova/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 diff --git a/playbooks/roles/os_swift/tasks/swift_install.yml b/playbooks/roles/os_swift/tasks/swift_install.yml index 5d6c683e37..189bb04af7 100644 --- a/playbooks/roles/os_swift/tasks/swift_install.yml +++ b/playbooks/roles/os_swift/tasks/swift_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: + - swift-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/playbooks/roles/rabbitmq_server/tasks/rabbitmq_install.yml b/playbooks/roles/rabbitmq_server/tasks/rabbitmq_install.yml index 7dc1f5daaa..63e51cdc60 100644 --- a/playbooks/roles/rabbitmq_server/tasks/rabbitmq_install.yml +++ b/playbooks/roles/rabbitmq_server/tasks/rabbitmq_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: + - rabbitmq-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/playbooks/roles/repo_server/tasks/repo_install.yml b/playbooks/roles/repo_server/tasks/repo_install.yml index 382264909c..7885b6d2db 100644 --- a/playbooks/roles/repo_server/tasks/repo_install.yml +++ b/playbooks/roles/repo_server/tasks/repo_install.yml @@ -13,11 +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: + - repo-apt-packages + - name: Install apt packages apt: pkg: "{{ item }}" state: latest - update_cache: yes register: install_packages until: install_packages|success retries: 5 diff --git a/playbooks/roles/rsyslog_client/tasks/rsyslog_client_install.yml b/playbooks/roles/rsyslog_client/tasks/rsyslog_client_install.yml index 44867c9076..bb8820ab5f 100644 --- a/playbooks/roles/rsyslog_client/tasks/rsyslog_client_install.yml +++ b/playbooks/roles/rsyslog_client/tasks/rsyslog_client_install.yml @@ -25,12 +25,21 @@ tags: - rsyslog-client-apt-repositories +- name: Update apt sources + apt: + update_cache: yes + cache_valid_time: 600 + register: apt_update + until: apt_update|success + retries: 5 + delay: 2 + tags: + - rsyslog-client-apt-packages + - name: Install rsyslog 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/playbooks/roles/rsyslog_server/tasks/rsyslog_server_install.yml b/playbooks/roles/rsyslog_server/tasks/rsyslog_server_install.yml index 42f8a7818e..10159cdff6 100644 --- a/playbooks/roles/rsyslog_server/tasks/rsyslog_server_install.yml +++ b/playbooks/roles/rsyslog_server/tasks/rsyslog_server_install.yml @@ -25,12 +25,21 @@ tags: - rsyslog-apt-repositories +- name: Update apt sources + apt: + update_cache: yes + cache_valid_time: 600 + register: apt_update + until: apt_update|success + retries: 5 + delay: 2 + tags: + - rsyslog-apt-packages + - name: Install rsyslog 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/playbooks/utility-install.yml b/playbooks/utility-install.yml index f0ac0bf3d5..53555a2f9e 100644 --- a/playbooks/utility-install.yml +++ b/playbooks/utility-install.yml @@ -22,12 +22,20 @@ - { role: "pip_lock_down", tags: [ "utility-pip-lock-down" ] } - { role: "openstack_openrc", tags: [ "utility-openstack-openrc" ] } post_tasks: + - name: Update apt sources + apt: + update_cache: yes + cache_valid_time: 600 + register: apt_update + until: apt_update|success + retries: 5 + delay: 2 + tags: + - utility-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