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.

The tests/os_keystone-overrides.yml file is removed
as it is unnecessary given the merge of
https://review.openstack.org/381479

Depends-On: I0e6d43a9f22add78f693e8836f1dd852be74d6c5
Change-Id: Ief9c7f124eb58b986192b2f958c971197d410799
This commit is contained in:
Jesse Pretorius 2016-10-18 22:43:03 +01:00 committed by Jesse Pretorius (odyssey4me)
parent 6c902fc471
commit c5a0cce3c6
4 changed files with 15 additions and 30 deletions

View File

@ -28,8 +28,6 @@ keystone_shibboleth_repo: {}
# of an OpenStack-Ansible repo_server.
keystone_git_repo: https://git.openstack.org/openstack/keystone
keystone_git_install_branch: master
keystone_requirements_git_repo: https://git.openstack.org/openstack/requirements
keystone_requirements_git_install_branch: master
keystone_developer_mode: false
keystone_developer_constraints:
- "git+{{ keystone_git_repo }}@{{ keystone_git_install_branch }}#egg=keystone"

View File

@ -0,0 +1,7 @@
---
upgrade:
- The variables ``keystone_requirements_git_repo`` and
``keystone_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.

View File

@ -40,36 +40,15 @@
{% for item in keystone_developer_constraints %}
{{ item }}
{% endfor %}
when:
- keystone_developer_mode | bool
- name: Clone requirements git repository
git:
repo: "{{ keystone_requirements_git_repo }}"
dest: "/opt/requirements"
clone: yes
update: yes
version: "{{ keystone_requirements_git_install_branch }}"
when:
- keystone_developer_mode | bool
- 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:
- keystone_developer_mode | bool
- name: Set pip_install_options_fact when not in developer mode
set_fact:
pip_install_options_fact: "{{ pip_install_options|default('') }}"
when:
- not keystone_developer_mode | bool
when: keystone_developer_mode | bool
- name: Install required pip packages
pip:
name: "{{ keystone_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
@ -145,7 +124,10 @@
state: latest
virtualenv: "{{ keystone_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

View File

@ -1,2 +0,0 @@
---
install_test_packages: True