From e6544bdf3d383407fdbea8fc3091fb2957b5b17b Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Tue, 24 Mar 2015 12:35:16 -0400 Subject: [PATCH] Cleaning up Ironic Client and Shade Library installs Changed the Ironic client and Shade installations to utilize pip by default however with a flag that could be set in order to change the logic over to utilizing source based installation. --- roles/ironic-install/defaults/main.yml | 2 + .../tasks/ironicclient_source_install.yml | 25 +++++++++++ roles/ironic-install/tasks/main.yml | 43 +++++-------------- .../tasks/shade_source_install.yml | 25 +++++++++++ 4 files changed, 63 insertions(+), 32 deletions(-) create mode 100644 roles/ironic-install/tasks/ironicclient_source_install.yml create mode 100644 roles/ironic-install/tasks/shade_source_install.yml diff --git a/roles/ironic-install/defaults/main.yml b/roles/ironic-install/defaults/main.yml index b1408e744..67925091c 100644 --- a/roles/ironic-install/defaults/main.yml +++ b/roles/ironic-install/defaults/main.yml @@ -25,8 +25,10 @@ required_packages_ubuntu: - genisoimage - kpartx http_boot_folder: /httpboot +ironicclient_source_install: false ironic_url: "http://localhost:6385/" ssh_public_key_path: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub" +shade_source_install: false dib_env_vars: DIB_CLOUD_INIT_DATASOURCES: "ConfigDrive" ELEMENTS_PATH: "/opt/stack/diskimage-builder/elements" diff --git a/roles/ironic-install/tasks/ironicclient_source_install.yml b/roles/ironic-install/tasks/ironicclient_source_install.yml new file mode 100644 index 000000000..35f5554fe --- /dev/null +++ b/roles/ironic-install/tasks/ironicclient_source_install.yml @@ -0,0 +1,25 @@ +# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. +# +# 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: "python-ironicclient - Retrieving library from git.openstack.org" + command: git clone https://review.openstack.org/openstack/python-ironicclient chdir=/opt/stack creates=/opt/stack/python-ironicclient +- name: "python-ironicclient - Checking out master branch" + command: git checkout -f master chdir=/opt/stack/python-ironicclient +- name: "python-ironicclient - Resetting local repository" + command: git reset --hard master chdir=/opt/stack/python-ironicclient +- name: "python-ironicclient - Resyncing local repository" + command: git pull --ff-only chdir=/opt/stack/python-ironicclient +- name: "python-ironicclient - Installing patched python-ironicclient library." + command: pip install -I --force-reinstall /opt/stack/python-ironicclient diff --git a/roles/ironic-install/tasks/main.yml b/roles/ironic-install/tasks/main.yml index 2b3433a8a..95e07ddb7 100644 --- a/roles/ironic-install/tasks/main.yml +++ b/roles/ironic-install/tasks/main.yml @@ -49,28 +49,12 @@ # TODO: Remove this once it has landed. - name: "Ironic - Temporary - Retrieve 166903" shell: git fetch https://jkreger@review.openstack.org/openstack/ironic refs/changes/03/166903/4 && git checkout FETCH_HEAD chdir=/opt/stack/ironic -# TODO: The pip installation of python-ironicclient is disabled in order to -# support rev 158520. -#- name: "Install ironic client" -# pip name=python-ironicclient state=present -- name: "python-ironicclient - Retrieving library from git.openstack.org" - command: git clone https://review.openstack.org/openstack/python-ironicclient chdir=/opt/stack creates=/opt/stack/python-ironicclient -- name: "python-ironicclient - Checking out master branch" - command: git checkout -f master chdir=/opt/stack/python-ironicclient -- name: "python-ironicclient - Resetting local repository" - command: git reset --hard master chdir=/opt/stack/python-ironicclient -- name: "python-ironicclient - Resyncing local repository" - command: git pull --ff-only chdir=/opt/stack/python-ironicclient -# This patch is https://review.openstack.org/#/c/158520/ which adds support -# for use of node names instead of UUIDs. We don't presently utilize this -# but it can be supported at some point. -- name: "python-ironicclient - Downloading patch for logical names in Ironic" - command: git fetch https://review.openstack.org/openstack/python-ironicclient refs/changes/20/158520/1 chdir=/opt/stack/python-ironicclient -- name: "python-ironicclient - Checking out patch." - command: git checkout FETCH_HEAD chdir=/opt/stack/python-ironicclient -- name: "python-ironicclient - Installing patched python-ironicclient library." - command: pip install -I --force-reinstall /opt/stack/python-ironicclient - when: skip_install is not defined +- name: "Ironic Client - Install from source if configured to do so." + include: shade_source_install.yml + when: skip_install is not defined and ironicclient_source_install is defined and ironicclient_source_install == true +- name: "Ironic Client - Install from pip" + pip: name=python-ironicclient state=present + when: skip_install is not defined and (ironicclient_source_install is not defined or ironicclient_source_install == false) - name: "proliantutils - Install from pip" pip: name=proliantutils state=present when: skip_install is not defined @@ -80,17 +64,12 @@ # TODO: If the portion below remains for any period of time, it should # be converted to an include... or consider converting to the integrated # git module. -- name: "Shade - Retrieving library from git.openstack.org" - command: git clone https://review.openstack.org/openstack-infra/shade chdir=/opt/stack creates=/opt/stack/shade -- name: "Shade - Checking out master branch" - command: git checkout -f master chdir=/opt/stack/shade -- name: "Shade - Resetting local repository" - command: git reset --hard master chdir=/opt/stack/shade -- name: "Shade - Resyncing local repository" - command: git pull --ff-only chdir=/opt/stack/shade +- name: "Shade - Install from source if configured to do so" + include: shade_source_install.yml + when: skip_install is not defined and shade_source_install is defined and shade_source_install == true - name: "Shade - Installing patched shade library." - command: pip install -I --force-reinstall /opt/stack/shade - when: skip_install is not defined + pip: name=shade state=latest + when: skip_install is not defined and (shade_source_install is not defined or shade_source_install == false) - name: "Include diskimage-builder installation" include: dib_install.yml when: create_image_via_dib == true diff --git a/roles/ironic-install/tasks/shade_source_install.yml b/roles/ironic-install/tasks/shade_source_install.yml new file mode 100644 index 000000000..2b3b1a5b4 --- /dev/null +++ b/roles/ironic-install/tasks/shade_source_install.yml @@ -0,0 +1,25 @@ +# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. +# +# 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: "Shade - Retrieving library from git.openstack.org" + command: git clone https://review.openstack.org/openstack-infra/shade chdir=/opt/stack creates=/opt/stack/shade +- name: "Shade - Checking out master branch" + command: git checkout -f master chdir=/opt/stack/shade +- name: "Shade - Resetting local repository" + command: git reset --hard master chdir=/opt/stack/shade +- name: "Shade - Resyncing local repository" + command: git pull --ff-only chdir=/opt/stack/shade +- name: "Shade - Installing patched shade library." + command: pip install -I --force-reinstall /opt/stack/shade