Update role for new source build process
The variables octavia_developer_mode and octavia_venv_download no longer carry any meaning. This review changes octavia to do the equivalent of what developer_mode was all the time, meaning that it always builds the venv and never requires the repo server, but it will use a repo server when available. As part of this, we move the source build out of its own file because it's now a single task to include the venv build role. This is just to make it easier to follow the code. Change-Id: I8ec47384778732a1e40392c843d02ea990b85c27
This commit is contained in:
parent
ea21d76875
commit
e62b66dcf8
@ -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]
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 }}"
|
Loading…
Reference in New Issue
Block a user