diff --git a/defaults/main.yml b/defaults/main.yml index dc6dc73..f7c8c10 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -21,8 +21,6 @@ sahara_pip_package_state: "latest" sahara_git_repo: https://git.openstack.org/openstack/sahara sahara_git_install_branch: master -sahara_requirements_git_repo: https://git.openstack.org/openstack/requirements -sahara_requirements_git_install_branch: master sahara_developer_mode: false sahara_developer_constraints: - "git+{{ sahara_git_repo }}@{{ sahara_git_install_branch }}#egg=sahara" diff --git a/releasenotes/notes/remove-requirements-git-59f58bcf4e54a569.yaml b/releasenotes/notes/remove-requirements-git-59f58bcf4e54a569.yaml new file mode 100644 index 0000000..891d310 --- /dev/null +++ b/releasenotes/notes/remove-requirements-git-59f58bcf4e54a569.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - The variables ``sahara_requirements_git_repo`` and + ``sahara_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. diff --git a/tasks/sahara_install.yml b/tasks/sahara_install.yml index c9c98f2..81137d1 100644 --- a/tasks/sahara_install.yml +++ b/tasks/sahara_install.yml @@ -25,33 +25,13 @@ when: - sahara_developer_mode | bool -- name: Clone requirements git repository - git: - repo: "{{ sahara_requirements_git_repo }}" - dest: "/opt/requirements" - clone: yes - update: yes - version: "{{ sahara_requirements_git_install_branch }}" - when: - - sahara_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: - - sahara_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 sahara_developer_mode | bool - - name: Install required pip packages pip: name: "{{ sahara_required_pip_packages | join(' ') }}" state: present - 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 @@ -109,7 +89,10 @@ state: "{{ sahara_pip_package_state }}" virtualenv: "{{ sahara_bin | dirname }}" virtualenv_site_packages: "no" - extra_args: "{{ pip_install_options_fact }}" + extra_args: >- + {{ sahara_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