Julia Kreger 4e8b86b979 Reorder client install order
Openstackclient now installs openstacksdk.

So we must install it along with shade last if we wish
to ensure that what is in GIT or what the user has specified
is to be installed overwriting what may have been pulled in
via dependency.

Depends-On: https://review.openstack.org/596530
Change-Id: I58e19c85400a1cd860aa4b870dc6c5eaa4686eb8
2018-08-25 11:40:00 +00:00

168 lines
6.6 KiB
YAML

# 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: "Update Package Cache"
apt: update_cache=yes
when: ansible_os_family == 'Debian'
- name: "Install packages"
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
with_items: "{{ required_packages }}"
- name: "If running in CI, set source install facts just to be sure"
set_fact:
shade_source_install: true
ironicclient_source_install: true
when: ci_testing | bool == true
- name: "If VENV is set in the environment, enable installation into venv"
set_fact:
enable_venv: true
when: lookup('env', 'VENV') | length > 0
# NOTE(TheJulia) While we don't necessarilly require /opt/stack any longer
# and it should already be created by the Ansible setup, we will leave this
# here for the time being.
- name: "Ensure /opt/stack is present"
file: name=/opt/stack state=directory owner=root group=root
- name: "OpenStack Client - Install"
include: pip_install.yml
package=python-openstackclient
extra_args="-c {{ upper_constraints_file }}"
when: skip_install is not defined
- name: "proliantutils - Install from pip"
include: pip_install.yml
package=proliantutils
state=present
extra_args="-c {{ upper_constraints_file }}"
when: skip_install is not defined
- name: "UcsSdk - Install from pip"
include: pip_install.yml
package=UcsSdk
version=0.8.1.9
extra_args="-c {{ upper_constraints_file }}"
when: skip_install is not defined
# TODO(dtantsur): only do this is the iscsi deploy interface is enabled
- name: "Install iSCSI client if PXE driver support is enabled"
action: "{{ ansible_pkg_mgr }} name={{ iscsi_client_package }} state=present"
when: skip_install is not defined
# NOTE(pas-ha) even when install into virtualenv is requested,
# we need to install shade into system for enroll-dynamic to succeed
- block:
- name: install shade from PyPI
command: "{{ hostvars[inventory_hostname].ansible_python.executable }} -m pip install shade"
when: not (shade_source_install | default(false) | bool)
- name: install shade from source
command: "{{ hostvars[inventory_hostname].ansible_python.executable }} -m pip install {{ shade_git_folder }}"
when: shade_source_install | default(false) | bool
when: skip_install is not defined
- name: "Diskimage-builder - Install"
include: pip_install.yml
package=diskimage-builder
sourcedir={{ dib_git_folder }}
source_install=true
# NOTE(TheJulia): DIB is in upper-constraints and can't be constrainted
# as a result.
when: skip_install is not defined and install_dib | bool == true
- name: "Ironic Client - Install"
include: pip_install.yml
package=python-ironicclient
state=latest
sourcedir={{ ironicclient_git_folder }}
source_install={{ ironicclient_source_install }}
# NOTE(TheJulia): We do not explicitly define an upper constraints file
# to be utilized in order to allow newer versions to be installed.
when: skip_install is not defined
- name: "Install configparser in venv if using"
include: pip_install.yml
package=configparser
virtualenv={{ bifrost_venv_dir }}
extra_args="-c {{ upper_constraints_file }}"
when: skip_install is not defined and (enable_venv | bool == true)
- name: "Install pymysql in venv if using"
include: pip_install.yml
package=pymysql
virtualenv={{ bifrost_venv_dir }}
extra_args="-c {{ upper_constraints_file }}"
when: skip_install is not defined and (enable_venv | bool == true)
# NOTE(hwoarang): The python-pymysql package is not available on the CentOS7
# and old Debian/Ubuntu repositories so we need to get it via pip
- name: "Install pymysql on CentOS/Ubuntu if necessary"
include: pip_install.yml
package=pymysql
extra_args="-c {{ upper_constraints_file }}"
when:
- skip_install is not defined
- enable_venv | bool == false
- (ansible_distribution == 'CentOS' and ansible_distribution_major_version|version_compare('7', '<=')) or
(ansible_distribution == 'Ubuntu' and ansible_distribution_version|version_compare('14.10', '==')) or
(ansible_distribution == 'Fedora' and ansible_distribution_version|version_compare('25', '>='))
- name: "Install extra packages for ironic"
include: pip_install.yml
package={{ item }}
extra_args="-c {{ upper_constraints_file }}"
with_items: "{{ ironic_extra_packages }}"
- name: "Install Ironic using pip"
include: pip_install.yml
package=ironic
state=latest
sourcedir={{ ironic_git_folder }}
source_install=true
extra_args="--no-cache-dir --upgrade -c {{ upper_constraints_file }}"
when: skip_install is not defined
- name: "Install ironic-inspector to permit use of inspection interface"
include: inspector_install.yml
when: skip_install is not defined and enable_inspector | bool == true
- name: "Install ironic-staging-drivers"
include: staging_install.yml
when: skip_install is not defined and staging_drivers_include | bool == true
# NOTE(pas-ha) even when install into virtualenv is requested,
# we need to install shade into system for enroll-dynamic to succeed
- block:
- name: install shade from PyPI
command: "{{ hostvars[inventory_hostname].ansible_python.executable }} -m pip install shade"
when: not (shade_source_install | default(false) | bool)
- name: install shade from source
command: "{{ hostvars[inventory_hostname].ansible_python.executable }} -m pip install {{ shade_git_folder }}"
when: shade_source_install | default(false) | bool
when: skip_install is not defined
# NOTE(TheJulia): Install openstacksdk since shade wraps to openstacksdk and the
# logic is largely going into openstacksdk as time goes on.
- block:
- name: install openstacksdk from PyPI
command: "{{ hostvars[inventory_hostname].ansible_python.executable }} -m pip install openstacksdk"
when: not (openstacksdk_source_install | default(false) | bool)
- name: install openstacksdk from source
command: "{{ hostvars[inventory_hostname].ansible_python.executable }} -m pip install {{ openstacksdk_git_folder }}"
when: openstacksdk_source_install | default(false) | bool
when: skip_install is not defined