Sync pip_install files
We've made changes to the primary role install files, however we didn't make the same changes to the keystone role file. Change-Id: I8b35bd30d94f997045ae37edcdb7691a25f2c57b
This commit is contained in:
parent
76c915aca2
commit
a7cfcd2a1c
@ -33,7 +33,6 @@
|
|||||||
include: pip_install.yml
|
include: pip_install.yml
|
||||||
package=configparser
|
package=configparser
|
||||||
virtualenv=bifrost_venv_dir
|
virtualenv=bifrost_venv_dir
|
||||||
extra_args="-c {{ upper_constraints_file }}"
|
|
||||||
when:
|
when:
|
||||||
- skip_install is not defined
|
- skip_install is not defined
|
||||||
- enable_venv | bool == true
|
- enable_venv | bool == true
|
||||||
@ -42,7 +41,6 @@
|
|||||||
include: pip_install.yml
|
include: pip_install.yml
|
||||||
package=pymysql
|
package=pymysql
|
||||||
virtualenv=bifrost_venv_dir
|
virtualenv=bifrost_venv_dir
|
||||||
extra_args="-c {{ upper_constraints_file }}"
|
|
||||||
when:
|
when:
|
||||||
- skip_install is not defined
|
- skip_install is not defined
|
||||||
- enable_venv | bool == true
|
- enable_venv | bool == true
|
||||||
@ -51,7 +49,6 @@
|
|||||||
include: pip_install.yml
|
include: pip_install.yml
|
||||||
package=python-openstackclient
|
package=python-openstackclient
|
||||||
virtualenv=bifrost_venv_dir
|
virtualenv=bifrost_venv_dir
|
||||||
extra_args="-c {{ upper_constraints_file }}"
|
|
||||||
when:
|
when:
|
||||||
- skip_install is not defined
|
- skip_install is not defined
|
||||||
- enable_venv | bool == true
|
- enable_venv | bool == true
|
||||||
@ -63,7 +60,7 @@
|
|||||||
state=latest
|
state=latest
|
||||||
sourcedir={{ keystone_git_folder }}
|
sourcedir={{ keystone_git_folder }}
|
||||||
source_install={{ keystone_source_install | bool }}
|
source_install={{ keystone_source_install | bool }}
|
||||||
extra_args="--no-cache-dir {{ pip_opts }} -c {{ upper_constraints_file }}"
|
extra_args="--no-cache-dir {{ pip_opts }}"
|
||||||
when:
|
when:
|
||||||
- skip_install is not defined
|
- skip_install is not defined
|
||||||
- enable_venv | bool == true
|
- enable_venv | bool == true
|
||||||
@ -71,7 +68,6 @@
|
|||||||
- name: "Install configparser if not using a venv"
|
- name: "Install configparser if not using a venv"
|
||||||
include: pip_install.yml
|
include: pip_install.yml
|
||||||
package=configparser
|
package=configparser
|
||||||
extra_args="-c {{ upper_constraints_file }}"
|
|
||||||
when:
|
when:
|
||||||
- skip_install is not defined
|
- skip_install is not defined
|
||||||
- enable_venv | bool == false
|
- enable_venv | bool == false
|
||||||
@ -79,7 +75,6 @@
|
|||||||
- name: "Install pymysql if not using a venv"
|
- name: "Install pymysql if not using a venv"
|
||||||
include: pip_install.yml
|
include: pip_install.yml
|
||||||
package=pymysql
|
package=pymysql
|
||||||
extra_args="-c {{ upper_constraints_file }}"
|
|
||||||
when:
|
when:
|
||||||
- skip_install is not defined
|
- skip_install is not defined
|
||||||
- enable_venv | bool == false
|
- enable_venv | bool == false
|
||||||
@ -87,7 +82,6 @@
|
|||||||
- name: "Install python-openstackclient if not using a venv"
|
- name: "Install python-openstackclient if not using a venv"
|
||||||
include: pip_install.yml
|
include: pip_install.yml
|
||||||
package=python-openstackclient
|
package=python-openstackclient
|
||||||
extra_args="-c {{ upper_constraints_file }}"
|
|
||||||
when:
|
when:
|
||||||
- skip_install is not defined
|
- skip_install is not defined
|
||||||
- enable_venv | bool == false
|
- enable_venv | bool == false
|
||||||
@ -98,7 +92,7 @@
|
|||||||
state=latest
|
state=latest
|
||||||
sourcedir={{ keystone_git_folder }}
|
sourcedir={{ keystone_git_folder }}
|
||||||
source_install={{ keystone_source_install | bool }}
|
source_install={{ keystone_source_install | bool }}
|
||||||
extra_args="--no-cache-dir {{ pip_opts }} -c {{ upper_constraints_file }}"
|
extra_args="--no-cache-dir {{ pip_opts }}"
|
||||||
when:
|
when:
|
||||||
- skip_install is not defined
|
- skip_install is not defined
|
||||||
- enable_venv | bool == false
|
- enable_venv | bool == false
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# Copyright (c) 2015 Hewlett Packard Enterprise Development LP.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -17,6 +19,15 @@
|
|||||||
venv_command: "python3 -m venv"
|
venv_command: "python3 -m venv"
|
||||||
when: enable_venv
|
when: enable_venv
|
||||||
|
|
||||||
|
- name: Set extra_args if upper_constraints_file is defined
|
||||||
|
set_fact:
|
||||||
|
constraints_extra_args: "{{ extra_args | default('') }} -c {{ upper_constraints_file }}"
|
||||||
|
when:
|
||||||
|
- (upper_constraints_file | default('')) != ''
|
||||||
|
# NOTE(dtantsur): constraining does not work correctly correctly with
|
||||||
|
# source installation if the package itself is in constraints.
|
||||||
|
- source_install is not defined or source_install == false
|
||||||
|
|
||||||
- name: "Install {{ package }} package from pip using virtualenv"
|
- name: "Install {{ package }} package from pip using virtualenv"
|
||||||
pip:
|
pip:
|
||||||
name: "{{ package }}"
|
name: "{{ package }}"
|
||||||
@ -24,7 +35,7 @@
|
|||||||
version: "{{ version | default(omit) }}"
|
version: "{{ version | default(omit) }}"
|
||||||
virtualenv: "{{ bifrost_venv_dir }}"
|
virtualenv: "{{ bifrost_venv_dir }}"
|
||||||
virtualenv_command: "{{ venv_command | default(omit) }}"
|
virtualenv_command: "{{ venv_command | default(omit) }}"
|
||||||
extra_args: "{{ extra_args | default(omit) }}"
|
extra_args: "{{ constraints_extra_args | default(extra_args) | default(omit) }}"
|
||||||
requirements: "{{ requirements_file | default(omit) }}"
|
requirements: "{{ requirements_file | default(omit) }}"
|
||||||
register: pip_package_install_done
|
register: pip_package_install_done
|
||||||
until: pip_package_install_done is succeeded
|
until: pip_package_install_done is succeeded
|
||||||
@ -37,7 +48,7 @@
|
|||||||
name: "{{ package }}"
|
name: "{{ package }}"
|
||||||
state: "{{ state | default(omit) }}"
|
state: "{{ state | default(omit) }}"
|
||||||
version: "{{ version | default(omit) }}"
|
version: "{{ version | default(omit) }}"
|
||||||
extra_args: "{{ extra_args | default(omit) }}"
|
extra_args: "{{ constraints_extra_args | default(extra_args) | default(omit) }}"
|
||||||
requirements: "{{ requirements_file | default(omit) }}"
|
requirements: "{{ requirements_file | default(omit) }}"
|
||||||
executable: /usr/bin/pip3
|
executable: /usr/bin/pip3
|
||||||
register: pip_package_install_done
|
register: pip_package_install_done
|
||||||
@ -46,14 +57,22 @@
|
|||||||
delay: 10
|
delay: 10
|
||||||
when: (source_install is not defined or source_install | bool == false ) and enable_venv | default(false) | bool == false
|
when: (source_install is not defined or source_install | bool == false ) and enable_venv | default(false) | bool == false
|
||||||
|
|
||||||
# NOTE (cinerama): We should be able to use the pip module here and
|
# NOTE (cinerama): We should be able to use the pip module here
|
||||||
# possibly merge these two tasks when
|
- name: "Install requirements from {{ sourcedir }} using pip"
|
||||||
# https://github.com/ansible/ansible-modules-core/pull/2600 lands.
|
command: |
|
||||||
- name: "Install from {{ sourcedir | default(package) }} using pip"
|
pip3 install -r {{ sourcedir }}/requirements.txt
|
||||||
command: pip3 install {{ sourcedir | default(package) }} {{ extra_args | default('') }}
|
{{ extra_args | default('') }}
|
||||||
|
{% if upper_constraints_file %}-c {{ upper_constraints_file }}{% endif %}
|
||||||
register: pip_package_install_done
|
register: pip_package_install_done
|
||||||
until: pip_package_install_done is succeeded
|
until: pip_package_install_done is succeeded
|
||||||
retries: 5
|
retries: 5
|
||||||
delay: 10
|
delay: 10
|
||||||
when: source_install is defined and source_install | default(true) | bool
|
when: source_install is defined and source_install | default(true) | bool
|
||||||
environment: "{{ bifrost_venv_env if enable_venv else {} }}"
|
environment: "{{ bifrost_venv_env if enable_venv else {} }}"
|
||||||
|
|
||||||
|
# NOTE(dtantsur): do not use constraints here, it does not work when the
|
||||||
|
# package itself is constrained.
|
||||||
|
- name: "Install from {{ sourcedir }} using pip"
|
||||||
|
command: pip3 install {{ sourcedir }} {{ extra_args | default('') }}
|
||||||
|
when: source_install is defined and (source_install | bool == true)
|
||||||
|
environment: "{{ bifrost_venv_env if enable_venv else {} }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user