Fix how constraints are added to pip_install_options

This commit changes the pip_install_options fact name in
swift_install.yml to pip_install_options_fact.  This allows us to
maintain the existing pip_install_options variable without overwriting
it with options when in developer mode, which ultimately means we can
have multiple services running in a container use a combination of
*_developer_mode: true and *_developer_mode: false.  At the moment,
if a service writes pip_install_options fact with the constraints
options, those options will persist to other services running in the
container even if *_developer_mode: false.

Change-Id: I248aeecafe9ac4e06e3e24796dd279f67c6589dd
This commit is contained in:
Matt Thompson 2016-03-17 15:52:17 +00:00
parent 0b834970a5
commit 6883896934

View File

@ -71,11 +71,18 @@
- name: Add constraints to pip_install_options fact for developer mode
set_fact:
pip_install_options: "{{ pip_install_options|default('') }} --constraint /opt/developer-pip-constraints.txt --constraint /opt/requirements/upper-constraints.txt"
pip_install_options_fact: "{{ pip_install_options|default('') }} --constraint /opt/developer-pip-constraints.txt --constraint /opt/requirements/upper-constraints.txt"
when:
- swift_developer_mode | bool
- "'/opt/developer-pip-constraints.txt' not in pip_install_options|default('')"
- "'/opt/requirements/upper-constraints.txt' not in pip_install_options|default('')"
tags:
- swift-install
- swift-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 swift_developer_mode | bool
tags:
- swift-install
- swift-pip-packages
@ -84,7 +91,7 @@
pip:
name: "{{ item }}"
state: present
extra_args: "{{ pip_install_options|default('') }}"
extra_args: "{{ pip_install_options_fact }}"
register: install_packages
until: install_packages|success
retries: 5
@ -205,7 +212,7 @@
state: present
virtualenv: "{{ swift_venv_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: "{{ pip_install_options|default('') }}"
extra_args: "{{ pip_install_options_fact }}"
register: install_packages
until: install_packages|success
retries: 5
@ -227,7 +234,7 @@
pip:
name: "{{ item }}"
state: present
extra_args: "{{ pip_install_options|default('') }}"
extra_args: "{{ pip_install_options_fact }}"
register: install_packages
until: install_packages|success
retries: 5