diff --git a/defaults/main.yml b/defaults/main.yml index 98344e4..b3c68cf 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -78,32 +78,18 @@ trove_conductor_workers: "{{ [[ansible_processor_vcpus|default(2) // 2, 1] | max # Enable/Disable Ceilometer trove_ceilometer_enabled: False -# 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. -trove_pip_install_args: >- - {{ trove_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('') }} +trove_pip_install_args: "{{ pip_install_options | default('') }}" # Name of the virtual env to deploy into trove_venv_tag: "{{ venv_tag | default('untagged') }}" trove_bin: "/openstack/venvs/trove-{{ trove_venv_tag }}/bin" -# venv_download, even when true, will use the fallback method of building the -# venv from scratch if the venv download fails. -trove_venv_download: "{{ not trove_developer_mode | bool }}" -trove_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/trove.tgz - trove_git_repo: "https://git.openstack.org/openstack/trove" trove_git_install_branch: master - -trove_developer_mode: false -trove_developer_constraints: +trove_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')) }}" +trove_git_constraints: - "git+{{ trove_git_repo }}@{{ trove_git_install_branch }}#egg=trove" + - "--constraint {{ trove_upper_constraints_url }}" #: Set this to false to disable API service through Apache + mod_wsgi trove_use_mod_wsgi: false @@ -165,6 +151,9 @@ trove_oslomsg_notify_vhost: "{{ trove_oslomsg_rpc_vhost }}" # TODO(ansmith): Change structure when more backends will be supported trove_oslomsg_amqp1_enabled: "{{ trove_oslomsg_rpc_transport == 'amqp' }}" +# Specific pip packages provided by the user +trove_user_pip_packages: [] + # Rabbit vars trove_control_exchange: trove trove_rabbit_notification_topic: notification diff --git a/tasks/main.yml b/tasks/main.yml index e4a4703..450d83e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -39,7 +39,20 @@ tags: - trove-install -- include_tasks: trove_install.yml +- name: Install the python venv + import_role: + name: "python_venv_build" + vars: + venv_build_constraints: "{{ trove_git_constraints }}" + venv_install_destination_path: "{{ trove_bin | dirname }}" + venv_install_distro_package_list: "{{ trove_distro_packages }}" + venv_pip_install_args: "{{ trove_pip_install_args }}" + venv_pip_packages: "{{ trove_pip_packages | union(trove_user_pip_packages) + + (trove_oslomsg_amqp1_enabled | bool) | ternary(trove_optional_oslomsg_amqp1_pip_packages, []) }}" + venv_facts_when_changed: + - section: "trove" + option: "venv_tag" + value: "{{ trove_venv_tag }}" tags: - trove-install diff --git a/tasks/trove_install.yml b/tasks/trove_install.yml deleted file mode 100644 index 244d0e3..0000000 --- a/tasks/trove_install.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -# Copyright 2016 Internet Solutions (Pty) Ltd -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# (c) 2016 Donovan Francesco -# (c) 2016 Paul Stevens - -# 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 trove_developer_constraints %} - {{ item }} - {% endfor %} - when: - - trove_developer_mode | bool - -- name: Ensure remote wheel building is disabled in developer mode - set_fact: - venv_build_host: "{{ ansible_hostname }}" - when: - - trove_developer_mode | bool - -- name: Install the python venv - include_role: - name: "python_venv_build" - vars: - venv_install_destination_path: "{{ trove_bin | dirname }}" - venv_install_distro_package_list: "{{ trove_distro_packages }}" - venv_pip_install_args: "{{ trove_pip_install_args }}" - venv_pip_packages: "{{ (trove_oslomsg_amqp1_enabled | bool) | ternary(trove_pip_packages + trove_optional_oslomsg_amqp1_pip_packages, trove_pip_packages) }}" - venv_facts_when_changed: - - section: "trove" - option: "venv_tag" - value: "{{ trove_venv_tag }}"