playbooks: Use --upgrade-strategy option for openSUSE distributions

This is a variation of 483e3a7a6f ("Fix
for proper installation"). PIP >= 10 gets really upset if one is mixing
distro and pip packages and openSUSE is being hit by this problem in the
gates. As such, lets use --upgrade-strategy only-if-needed for openSUSE
by default until we can properly isolate the bifrost installation into
its own virtual environment.

Change-Id: Idac094ecc749250f023dd49b2ad9cd220158f248
This commit is contained in:
Markos Chandras 2018-10-23 09:28:22 +01:00
parent e1048b198b
commit 6fd0e65b10
5 changed files with 13 additions and 5 deletions

View File

@ -277,3 +277,7 @@ ironic_inspector:
host: "localhost"
# DEPRECATED(TheJulia): Inheritance of ironic_db_password params
# should be removed in Queens.
# NOTE(hwoarang): openSUSE distros may come with recent pip versions so
# upgrade only what's necessary
pip_opts: "{{ ((ansible_os_family | lower == 'suse') or (enable_venv | bool)) | ternary('--upgrade-strategy only-if-needed', '--force-reinstall') }}"

View File

@ -19,7 +19,7 @@
state=latest
sourcedir={{ ironicinspector_git_folder }}
source_install={{ ironicinspector_source_install }}
extra_args="--no-cache-dir --upgrade {% if enable_venv | bool %}--upgrade-strategy only-if-needed{% else %}--force-reinstall{% endif %} -c {{ upper_constraints_file }}"
extra_args="--no-cache-dir --upgrade {{ pip_opts }} -c {{ upper_constraints_file }}"
- name: "Inspector - PIP client install"
include: pip_install.yml
@ -27,4 +27,4 @@
state=latest
sourcedir={{ ironicinspectorclient_git_folder }}
source_install={{ ironicinspectorclient_source_install }}
extra_args="--no-cache-dir --upgrade {% if enable_venv | bool %}--upgrade-strategy only-if-needed{% else %}--force-reinstall{% endif %} -c {{ upper_constraints_file }}"
extra_args="--no-cache-dir --upgrade {{ pip_opts }} -c {{ upper_constraints_file }}"

View File

@ -124,7 +124,7 @@
state=latest
sourcedir={{ ironic_git_folder }}
source_install=true
extra_args="--no-cache-dir --upgrade -c {{ upper_constraints_file }}"
extra_args="--no-cache-dir --upgrade {{ pip_opts }} -c {{ upper_constraints_file }}"
when: skip_install is not defined
- name: "Install ironic-inspector to permit use of inspection interface"

View File

@ -60,3 +60,7 @@ keystone:
username: keystone
password: ChangeThisPa55w0rd
host: localhost
# NOTE(hwoarang): openSUSE distros may come with recent pip versions so
# upgrade only what's necessary
pip_opts: "{{ ((ansible_os_family | lower == 'suse') or (enable_venv | bool)) | ternary('--upgrade-strategy only-if-needed', '--force-reinstall') }}"

View File

@ -63,7 +63,7 @@
state=latest
sourcedir={{ keystone_git_folder }}
source_install={{ keystone_source_install | bool }}
extra_args="--no-cache-dir --upgrade {% if enable_venv | bool %}--upgrade-strategy only-if-needed{% else %}--force-reinstall{% endif %} -c {{ upper_constraints_file }}"
extra_args="--no-cache-dir --upgrade {{ pip_opts }} -c {{ upper_constraints_file }}"
when:
- skip_install is not defined
- enable_venv | bool == true
@ -98,7 +98,7 @@
state=latest
sourcedir={{ keystone_git_folder }}
source_install={{ keystone_source_install | bool }}
extra_args="--no-cache-dir --upgrade {% if enable_venv | bool %}--upgrade-strategy only-if-needed{% else %}--force-reinstall{% endif %} -c {{ upper_constraints_file }}"
extra_args="--no-cache-dir --upgrade {{ pip_opts }} -c {{ upper_constraints_file }}"
when:
- skip_install is not defined
- enable_venv | bool == false