Fix how constraints are added to pip_install_options
This commit changes the pip_install_options fact name in nova_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: Ifbc0e3e345e321b908088d3ea7fc1b1041ae084b
This commit is contained in:
parent
8bdb2e2626
commit
73a5c69006
@ -71,11 +71,18 @@
|
|||||||
|
|
||||||
- name: Add constraints to pip_install_options fact for developer mode
|
- name: Add constraints to pip_install_options fact for developer mode
|
||||||
set_fact:
|
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:
|
when:
|
||||||
- nova_developer_mode | bool
|
- nova_developer_mode | bool
|
||||||
- "'/opt/developer-pip-constraints.txt' not in pip_install_options|default('')"
|
tags:
|
||||||
- "'/opt/requirements/upper-constraints.txt' not in pip_install_options|default('')"
|
- nova-install
|
||||||
|
- nova-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 nova_developer_mode | bool
|
||||||
tags:
|
tags:
|
||||||
- nova-install
|
- nova-install
|
||||||
- nova-pip-packages
|
- nova-pip-packages
|
||||||
@ -84,7 +91,7 @@
|
|||||||
pip:
|
pip:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
extra_args: "{{ pip_install_options|default('') }}"
|
extra_args: "{{ pip_install_options_fact }}"
|
||||||
register: install_packages
|
register: install_packages
|
||||||
until: install_packages|success
|
until: install_packages|success
|
||||||
retries: 5
|
retries: 5
|
||||||
@ -201,7 +208,7 @@
|
|||||||
state: present
|
state: present
|
||||||
virtualenv: "{{ nova_venv_bin | dirname }}"
|
virtualenv: "{{ nova_venv_bin | dirname }}"
|
||||||
virtualenv_site_packages: "no"
|
virtualenv_site_packages: "no"
|
||||||
extra_args: "{{ pip_install_options|default('') }}"
|
extra_args: "{{ pip_install_options_fact }}"
|
||||||
register: install_packages
|
register: install_packages
|
||||||
until: install_packages|success
|
until: install_packages|success
|
||||||
retries: 5
|
retries: 5
|
||||||
@ -219,7 +226,7 @@
|
|||||||
pip:
|
pip:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
extra_args: "{{ pip_install_options|default('') }}"
|
extra_args: "{{ pip_install_options_fact }}"
|
||||||
register: install_packages
|
register: install_packages
|
||||||
until: install_packages|success
|
until: install_packages|success
|
||||||
retries: 5
|
retries: 5
|
||||||
|
Loading…
x
Reference in New Issue
Block a user