From 5821f8298c9deca7d5e34e831d7e09636d5e70ad Mon Sep 17 00:00:00 2001 From: Matt Thompson Date: Wed, 16 Mar 2016 14:47:24 +0000 Subject: [PATCH] Fix how constraints are added to pip_install_options This commit changes the pip_install_options fact name in keystone_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. If this change is accepted, the same will need to be done to all the IRRs. Change-Id: Ic76074da419685148e27f2f1295ddd2d82bb03f9 --- tasks/keystone_install.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tasks/keystone_install.yml b/tasks/keystone_install.yml index f91da2b1..bc83fc6f 100644 --- a/tasks/keystone_install.yml +++ b/tasks/keystone_install.yml @@ -47,11 +47,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: - keystone_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: + - keystone-install + - keystone-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 keystone_developer_mode | bool tags: - keystone-install - keystone-pip-packages @@ -60,7 +67,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 @@ -178,7 +185,7 @@ state: present virtualenv: "{{ keystone_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 @@ -197,7 +204,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