diff --git a/defaults/main.yml b/defaults/main.yml index 35b631a7..e3a2025c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -65,32 +65,19 @@ magnum_config_overrides: {} magnum_policy_overrides: {} magnum_api_paste_ini_overrides: {} -# TODO(odyssey4me): -# This can be simplified once all the roles are using -# python_venv_build. We can then switch to using a -# set of constraints in pip.conf inside the venv, -# perhaps prepared by giving a giving a list of -# constraints to the role. -magnum_pip_install_args: >- - {{ magnum_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }} - {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''), '') }} - {{ pip_install_options | default('') }} +magnum_pip_install_args: "{{ pip_install_options | default('') }}" # Name of the virtual env to deploy into magnum_venv_tag: "{{ venv_tag | default('untagged') }}" magnum_venv_path: "/openstack/venvs/magnum-{{ magnum_venv_tag }}" magnum_bin: "{{ magnum_venv_path }}/bin" -# venv_download, even when true, will use the fallback method of building the -# venv from scratch if the venv download fails. -magnum_venv_download: "{{ not magnum_developer_mode | bool }}" -magnum_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/magnum.tgz - magnum_git_repo: "https://git.openstack.org/openstack/magnum" magnum_git_install_branch: master -magnum_developer_mode: false -magnum_developer_constraints: +magnum_upper_constraints_url: "{{ requirements_git_url | default('https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=' ~ requirements_git_install_branch | default('master')) }}" +magnum_git_constraints: - "git+{{ magnum_git_repo }}@{{ magnum_git_install_branch }}#egg=magnum" + - "--constraint {{ magnum_upper_constraints_url }}" # Database vars magnum_db_setup_host: "{{ ('galera_all' in groups) | ternary(groups['galera_all'][0], 'localhost') }}" diff --git a/tasks/magnum_install.yml b/tasks/magnum_install.yml index bc6106fd..b4464be7 100644 --- a/tasks/magnum_install.yml +++ b/tasks/magnum_install.yml @@ -13,31 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -# TODO(odyssey4me): -# This can be simplified once all the roles are using -# python_venv_build. We can then switch to using a -# set of constraints in pip.conf inside the venv, -# perhaps prepared by giving a giving a list of -# constraints to the role. -- name: Create developer mode constraint file - copy: - dest: "/opt/developer-pip-constraints.txt" - content: | - {% for item in magnum_developer_constraints %} - {{ item }} - {% endfor %} - when: magnum_developer_mode | bool - -- name: Ensure remote wheel building is disabled in developer mode - set_fact: - venv_build_host: "{{ ansible_hostname }}" - when: - - magnum_developer_mode | bool - - name: Install the python venv include_role: name: "python_venv_build" vars: + venv_build_constraints: "{{ magnum_git_constraints }}" venv_install_destination_path: "{{ magnum_bin | dirname }}" venv_install_distro_package_list: "{{ magnum_distro_packages }}" venv_pip_install_args: "{{ magnum_pip_install_args }}"