Merge "Simplify pip options/constraints mechanism"

This commit is contained in:
Jenkins 2016-10-20 17:09:53 +00:00 committed by Gerrit Code Review
commit b141222a47
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