From 19bc27e89390b3590d768ac93f78c32f52fd00b5 Mon Sep 17 00:00:00 2001 From: Hector I Gonzalez Date: Wed, 30 Mar 2016 14:57:07 -0500 Subject: [PATCH] Updated role using Multi-Distro framework * Moved APT cache var to ubuntu-14.04 file * Moved tags from cinder_install_apt.yml since they will be inherited * Updated meta/main.yml dependencies to include apt_package_pinning when ansible_pkg_mgr is apt. Change-Id: I23163f783f3b6bce4b170236c46c163d8068b5e0 --- defaults/main.yml | 2 -- meta/main.yml | 4 +++- tasks/cinder_install.yml | 3 ++- tasks/cinder_install_apt.yml | 10 ---------- vars/ubuntu-14.04.yml | 3 +++ 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index fe8a944b..9d5582f6 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -## APT Cache options -cache_timeout: 600 cinder_git_repo: https://git.openstack.org/openstack/cinder cinder_git_install_branch: master diff --git a/meta/main.yml b/meta/main.yml index b7080988..8ca77b8f 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -36,6 +36,8 @@ dependencies: - role: pip_install when: - cinder_developer_mode | bool - - apt_package_pinning + - role: apt_package_pinning + when: + - ansible_pkg_mgr == 'apt' - galera_client - openstack_openrc diff --git a/tasks/cinder_install.yml b/tasks/cinder_install.yml index a8fbfdec..70ef4485 100644 --- a/tasks/cinder_install.yml +++ b/tasks/cinder_install.yml @@ -17,7 +17,8 @@ when: - ansible_pkg_mgr == 'apt' tags: - - install-apt + - cinder-install + - cinder-apt-packages - name: Create developer mode constraint file copy: diff --git a/tasks/cinder_install_apt.yml b/tasks/cinder_install_apt.yml index 09295098..e2e62225 100644 --- a/tasks/cinder_install_apt.yml +++ b/tasks/cinder_install_apt.yml @@ -20,15 +20,11 @@ stat: path: /var/cache/apt register: apt_cache_stat - tags: - - cinder-apt-packages - name: Update apt if needed apt: update_cache: yes when: "ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}" - tags: - - cinder-apt-packages - name: Install apt packages apt: @@ -39,9 +35,6 @@ retries: 5 delay: 2 with_items: cinder_apt_packages - tags: - - cinder-install - - cinder-apt-packages - name: Install apt packages apt: @@ -55,6 +48,3 @@ when: - inventory_hostname in groups['cinder_volume'] - cinder_backend_lvm_inuse | bool - tags: - - cinder-install - - cinder-apt-packages diff --git a/vars/ubuntu-14.04.yml b/vars/ubuntu-14.04.yml index 0b0a34e2..affab733 100644 --- a/vars/ubuntu-14.04.yml +++ b/vars/ubuntu-14.04.yml @@ -13,6 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +## APT Cache options +cache_timeout: 600 + # Common apt packages cinder_apt_packages: - libpq-dev