Merge "Update role for new source build process"

This commit is contained in:
Zuul 2019-03-30 18:03:41 +00:00 committed by Gerrit Code Review
commit 35d7b39c4e
3 changed files with 21 additions and 64 deletions

View File

@ -45,27 +45,17 @@ octavia_pip_package_state: "latest"
octavia_git_repo: https://git.openstack.org/openstack/octavia
octavia_git_install_branch: master
octavia_developer_mode: false
octavia_developer_constraints:
octavia_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')) }}"
octavia_git_constraints:
- "git+{{ octavia_git_repo }}@{{ octavia_git_install_branch }}#egg=octavia"
- "--constraint {{ octavia_upper_constraints_url }}"
# 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.
octavia_pip_install_args: >-
{{ octavia_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('') }}
octavia_pip_install_args: "{{ pip_install_options | default('') }}"
# Name of the virtual env to deploy into
octavia_venv_tag: "{{ venv_tag | default('untagged') }}"
octavia_bin: "/openstack/venvs/octavia-{{ octavia_venv_tag }}/bin"
octavia_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/octavia.tgz
octavia_clients_endpoint: internalURL
octavia_auth_strategy: keystone
@ -169,6 +159,9 @@ octavia_pip_packages:
- shade
- uwsgi
# Specific pip packages provided by the user
octavia_user_pip_packages: []
octavia_optional_oslomsg_amqp1_pip_packages:
- oslo.messaging[amqp1]

View File

@ -42,7 +42,20 @@
tags:
- octavia-install
- include_tasks: octavia_install.yml
- name: Install the python venv
import_role:
name: "python_venv_build"
vars:
venv_build_constraints: "{{ octavia_git_constraints }}"
venv_install_destination_path: "{{ octavia_bin | dirname }}"
venv_install_distro_package_list: "{{ octavia_distro_packages }}"
venv_pip_install_args: "{{ octavia_pip_install_args }}"
venv_pip_packages: "{{ octavia_pip_packages | union(octavia_user_pip_packages) +
(octavia_oslomsg_amqp1_enabled | bool) | ternary(octavia_optional_oslomsg_amqp1_pip_packages, []) }}"
venv_facts_when_changed:
- section: "octavia"
option: "venv_tag"
value: "{{ octavia_venv_tag }}"
tags:
- octavia-install

View File

@ -1,49 +0,0 @@
---
# Copyright 2017, Rackspace US, Inc.
#
# 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.
# 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 octavia_developer_constraints %}
{{ item }}
{% endfor %}
when: octavia_developer_mode | bool
- name: Ensure remote wheel building is disabled in developer mode
set_fact:
venv_build_host: "{{ ansible_hostname }}"
when:
- octavia_developer_mode | bool
- name: Install the python venv
include_role:
name: "python_venv_build"
private: yes
vars:
venv_install_destination_path: "{{ octavia_bin | dirname }}"
venv_install_distro_package_list: "{{ octavia_distro_packages }}"
venv_pip_install_args: "{{ octavia_pip_install_args }}"
venv_pip_packages: "{{ (octavia_oslomsg_amqp1_enabled | bool) | ternary(octavia_pip_packages + octavia_optional_oslomsg_amqp1_pip_packages, octavia_pip_packages) }}"
venv_facts_when_changed:
- section: "octavia"
option: "venv_tag"
value: "{{ octavia_venv_tag }}"