Simplify pip options/constraints mechanism
The current constraints generation for the installation involves multiple tasks and multiple variables. Using multiple tasks extends the installation time unnecessarily and the additional variables are unnecessary. This patch aims to simplify the mechanism and hopes to speed it up a little. Change-Id: I018e2d345912722a6c5e6fbbbb5afd424807f3a4
This commit is contained in:
@@ -36,11 +36,9 @@ cloudkitty_bin: "/openstack/venvs/cloudkitty-{{ cloudkitty_venv_tag }}/bin"
|
||||
|
||||
cloudkitty_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/cloudkitty.tgz
|
||||
|
||||
cloudkitty_git_repo: https://github.com/openstack/cloudkitty.git
|
||||
cloudkitty_git_repo: https://git.openstack.org/openstack/cloudkitty
|
||||
cloudkitty_git_install_branch: master
|
||||
|
||||
cloudkitty_requirements_git_repo: https://git.openstack.org/openstack/requirements
|
||||
cloudkitty_requirements_git_install_branch: master
|
||||
cloudkitty_developer_constraints:
|
||||
- "git+{{ cloudkitty_git_repo }}@{{ cloudkitty_requirements_git_install_branch }}#egg=cloudkitty"
|
||||
|
||||
|
@@ -0,0 +1,7 @@
|
||||
---
|
||||
upgrade:
|
||||
- The variables ``cloudkitty_requirements_git_repo`` and
|
||||
``cloudkitty_requirements_git_install_branch`` have been
|
||||
removed in favour of using the URL/path to the
|
||||
upper-constraints file using the
|
||||
variable ``pip_install_upper_constraints`` instead.
|
@@ -34,39 +34,7 @@
|
||||
{% for item in cloudkitty_developer_constraints %}
|
||||
{{ item }}
|
||||
{% endfor %}
|
||||
when:
|
||||
- cloudkitty_developer_mode | bool
|
||||
tags:
|
||||
- cloudkitty-install
|
||||
- cloudkitty-pip-packages
|
||||
|
||||
- name: Clone requirements git repository
|
||||
git:
|
||||
repo: "{{ cloudkitty_requirements_git_repo }}"
|
||||
dest: "/opt/requirements"
|
||||
clone: yes
|
||||
update: yes
|
||||
version: "{{ cloudkitty_requirements_git_install_branch }}"
|
||||
when:
|
||||
- cloudkitty_developer_mode | bool
|
||||
tags:
|
||||
- cloudkitty-install
|
||||
- cloudkitty-pip-packages
|
||||
|
||||
- name: Add constraints to pip_install_options fact for developer mode
|
||||
set_fact:
|
||||
pip_install_options_fact: "{{ pip_install_options|default('') }} --constraint /opt/developer-pip-constraints.txt --constraint /opt/requirements/upper-constraints.txt"
|
||||
when:
|
||||
- cloudkitty_developer_mode | bool
|
||||
tags:
|
||||
- cloudkitty-install
|
||||
- cloudkitty-pip-packages
|
||||
|
||||
- name: Set pip_install_options_fact when not in developer mode
|
||||
set_fact:
|
||||
pip_install_options_fact: "{{ pip_install_options|default('') }}"
|
||||
when:
|
||||
- not cloudkitty_developer_mode | bool
|
||||
when: cloudkitty_developer_mode | bool
|
||||
tags:
|
||||
- cloudkitty-install
|
||||
- cloudkitty-pip-packages
|
||||
@@ -75,7 +43,9 @@
|
||||
pip:
|
||||
name: "{{ cloudkitty_requires_pip_packages | join(' ') }}"
|
||||
state: latest
|
||||
extra_args: "{{ pip_install_options_fact }}"
|
||||
extra_args: >-
|
||||
{{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }}
|
||||
{{ pip_install_options | default('') }}
|
||||
register: install_packages
|
||||
until: install_packages|success
|
||||
retries: 5
|
||||
@@ -172,7 +142,10 @@
|
||||
state: latest
|
||||
virtualenv: "{{ cloudkitty_bin | dirname }}"
|
||||
virtualenv_site_packages: "no"
|
||||
extra_args: "{{ pip_install_options_fact }}"
|
||||
extra_args: >-
|
||||
{{ keystone_developer_mode | ternary('--constraint /opt/developer-pip-constraints.txt', '') }}
|
||||
{{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }}
|
||||
{{ pip_install_options | default('') }}
|
||||
register: install_packages
|
||||
until: install_packages|success
|
||||
retries: 5
|
||||
|
Reference in New Issue
Block a user