From 75e85cff4c0d935ca5bb7af4fe051ce026071058 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Mon, 21 Mar 2016 16:16:57 +0000 Subject: [PATCH] Consolidate pip install tasks The pip install tasks were distributed into many files with no clear benefit from doing so. This patch consolidates the pip install tasks to ensure that they are all handled together, are all installed into the appropriate venv, and all use the right constraints. Change-Id: I8bad68c57c0ffa986817aa80d79e9d2ab4b86a3d --- defaults/main.yml | 12 ++----- tasks/ironic_api_install.yml | 15 -------- tasks/ironic_conductor_install.yml | 15 -------- tasks/ironic_install.yml | 6 ++-- tasks/main.yml | 2 -- tasks/python_ironicclient_install.yml | 50 --------------------------- 6 files changed, 4 insertions(+), 96 deletions(-) delete mode 100644 tasks/python_ironicclient_install.yml diff --git a/defaults/main.yml b/defaults/main.yml index 2baa0e74..48f53dbf 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -124,20 +124,15 @@ ironic_requires_pip_packages: - python-keystoneclient # Keystoneclient needed for the OSA keystone lib ironic_pip_packages: - - mysql-python + - MySQL-python - ironic + - python-ironicclient ironic_api_apt_packages: - apache2 - apache2-utils - libapache2-mod-wsgi -ironic_api_pip_packages: - - mysql-python - -python_ironicclient_pip_packages: - - python-ironicclient - ironic_conductor_apt_packages: - libxml2-dev - rabbitmq-server @@ -154,9 +149,6 @@ ironic_conductor_standalone_apt_packages: - isc-dhcp-server - tftpd-hpa -ironic_conductor_pip_packages: - - mysql-python - ## RabbitMQ info ironic_rabbitmq_userid: ironic ironic_rabbitmq_vhost: /ironic diff --git a/tasks/ironic_api_install.yml b/tasks/ironic_api_install.yml index 58a5996c..326165b6 100644 --- a/tasks/ironic_api_install.yml +++ b/tasks/ironic_api_install.yml @@ -26,18 +26,3 @@ - ironic-install - ironic-api - ironic-apt-packages - -- name: Install ironic-api specific pip dependencies - pip: - name: "{{ item }}" - state: present - extra_args: "{{ pip_install_options_fact }}" - register: install_packages - until: install_packages|success - retries: 5 - delay: 2 - with_items: ironic_api_pip_packages - tags: - - ironic-install - - ironic-api - - ironic-pip-packages diff --git a/tasks/ironic_conductor_install.yml b/tasks/ironic_conductor_install.yml index e495bd6a..b66b963f 100644 --- a/tasks/ironic_conductor_install.yml +++ b/tasks/ironic_conductor_install.yml @@ -41,18 +41,3 @@ - ironic-install - ironic-conductor - ironic-apt-packages - -- name: Install ironic-conductor specific pip dependencies - pip: - name: "{{ item }}" - state: present - extra_args: "{{ pip_install_options_fact }}" - register: install_packages - until: install_packages|success - retries: 5 - delay: 2 - with_items: ironic_conductor_pip_packages - tags: - - ironic-install - - ironic-conductor - - ironic-pip-packages diff --git a/tasks/ironic_install.yml b/tasks/ironic_install.yml index 17816cf8..707cd712 100644 --- a/tasks/ironic_install.yml +++ b/tasks/ironic_install.yml @@ -82,8 +82,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: - - "{{ ironic_pip_packages }}" + with_items: ironic_pip_packages when: - ironic_venv_enabled | bool - ironic_developer_mode | bool @@ -100,8 +99,7 @@ until: install_packages|success retries: 5 delay: 2 - with_items: - - "{{ ironic_pip_packages }}" + with_items: ironic_pip_packages when: - not ironic_venv_enabled | bool - not ironic_developer_mode | bool diff --git a/tasks/main.yml b/tasks/main.yml index c20b6ae6..7818767d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -24,8 +24,6 @@ when: > inventory_hostname in groups['ironic_conductor'] - - include: python_ironicclient_install.yml - - include: ironic_post_install.yml - include: ironic_api_post_install.yml diff --git a/tasks/python_ironicclient_install.yml b/tasks/python_ironicclient_install.yml deleted file mode 100644 index ef59857a..00000000 --- a/tasks/python_ironicclient_install.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -# Copyright 2014, Rackspace US, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -- name: Install python-ironicclient pip packages (venv) - pip: - name: "{{ item }}" - state: present - virtualenv: "{{ ironic_venv_bin | dirname }}" - virtualenv_site_packages: "no" - extra_args: "{{ pip_install_options_fact }}" - register: install_packages - until: install_packages|success - retries: 5 - delay: 2 - with_items: - - "{{ python_ironicclient_pip_packages }}" - when: - - ironic_venv_enabled | bool - tags: - - ironicclient-install - - ironicclient-pip-packages - -- name: Install python-ironicclient pip packages (no venv) - pip: - name: "{{ item }}" - state: present - extra_args: "{{ pip_install_options_fact }}" - register: install_packages - until: install_packages|success - retries: 5 - delay: 2 - with_items: - - "{{ python_ironicclient_pip_packages }}" - when: not ironic_venv_enabled | bool - tags: - - ironicclient-install - - ironicclient-pip-packages -