Update role for new source build process
The variables nova_developer_mode and nova_venv_download no longer carry any meaning. This review changes nova 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. We also change include_tasks to import_tasks and include_role to import_role so that the tags in the python_venv_build role will work. Change-Id: I1a1ac5948f3bd647eb0ee5e10e9e7ae06b740bb7
This commit is contained in:
parent
21703a6dfd
commit
377588a57c
@ -52,31 +52,17 @@ nova_git_install_branch: master
|
|||||||
nova_lxd_git_repo: https://git.openstack.org/openstack/nova-lxd
|
nova_lxd_git_repo: https://git.openstack.org/openstack/nova-lxd
|
||||||
nova_lxd_git_install_branch: master
|
nova_lxd_git_install_branch: master
|
||||||
|
|
||||||
nova_developer_mode: false
|
nova_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')) }}"
|
||||||
nova_developer_constraints:
|
nova_git_constraints:
|
||||||
- "git+{{ nova_git_repo }}@{{ nova_git_install_branch }}#egg=nova"
|
- "git+{{ nova_git_repo }}@{{ nova_git_install_branch }}#egg=nova"
|
||||||
- "git+{{ nova_lxd_git_repo }}@{{ nova_lxd_git_install_branch }}#egg=nova-lxd"
|
- "git+{{ nova_lxd_git_repo }}@{{ nova_lxd_git_install_branch }}#egg=nova-lxd"
|
||||||
|
- "--constraint {{ nova_upper_constraints_url }}"
|
||||||
# TODO(odyssey4me):
|
nova_pip_install_args: "{{ pip_install_options | default('') }}"
|
||||||
# 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.
|
|
||||||
nova_pip_install_args: >-
|
|
||||||
{{ nova_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('') }}
|
|
||||||
|
|
||||||
# Name of the virtual env to deploy into
|
# Name of the virtual env to deploy into
|
||||||
nova_venv_tag: "{{ venv_tag | default('untagged') }}"
|
nova_venv_tag: "{{ venv_tag | default('untagged') }}"
|
||||||
nova_bin: "{{ _nova_bin }}"
|
nova_bin: "{{ _nova_bin }}"
|
||||||
|
|
||||||
# venv_download, even when true, will use the fallback method of building the
|
|
||||||
# venv from scratch if the venv download fails.
|
|
||||||
nova_venv_download: "{{ not nova_developer_mode | bool }}"
|
|
||||||
nova_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/nova.tgz
|
|
||||||
|
|
||||||
nova_fatal_deprecations: False
|
nova_fatal_deprecations: False
|
||||||
|
|
||||||
## Nova user information
|
## Nova user information
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright 2016, Walmart Stores, 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.
|
|
||||||
|
|
||||||
- name: Install nova ironic packages from PIP
|
|
||||||
include_tasks: nova_compute_ironic_source.yml
|
|
||||||
when: nova_install_method == 'source'
|
|
@ -1,32 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright 2018, SUSE Linux GmbH.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
- name: Install pip packages (venv)
|
|
||||||
pip:
|
|
||||||
name: "{{ nova_compute_ironic_pip_packages }}"
|
|
||||||
state: "{{ nova_pip_package_state }}"
|
|
||||||
virtualenv: "{{ nova_bin | dirname }}"
|
|
||||||
virtualenv_site_packages: "no"
|
|
||||||
extra_args: >-
|
|
||||||
{{ nova_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('') }}
|
|
||||||
register: install_packages
|
|
||||||
until: install_packages is success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
tags:
|
|
||||||
- nova-install
|
|
||||||
- nova-pip-packages
|
|
@ -13,10 +13,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- name: Install nova lxd packages from PIP
|
|
||||||
include_tasks: nova_compute_lxd_source.yml
|
|
||||||
when: nova_install_method == 'source'
|
|
||||||
|
|
||||||
- name: Add nova user to lxd group
|
- name: Add nova user to lxd group
|
||||||
user:
|
user:
|
||||||
name: "{{ nova_system_user_name }}"
|
name: "{{ nova_system_user_name }}"
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright 2018, SUSE Linux GmbH.
|
|
||||||
#
|
|
||||||
# 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.
|
|
||||||
|
|
||||||
- name: Install pip packages (venv)
|
|
||||||
pip:
|
|
||||||
name: "{{ nova_compute_lxd_pip_packages }}"
|
|
||||||
state: "{{ nova_pip_package_state }}"
|
|
||||||
virtualenv: "{{ nova_bin | dirname }}"
|
|
||||||
virtualenv_site_packages: "no"
|
|
||||||
extra_args: >-
|
|
||||||
{{ nova_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('') }}
|
|
||||||
register: install_packages
|
|
||||||
until: install_packages is success
|
|
||||||
retries: 5
|
|
||||||
delay: 2
|
|
||||||
tags:
|
|
||||||
- nova-pip-packages
|
|
@ -69,23 +69,23 @@
|
|||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|
||||||
- include_tasks: nova_virt_detect.yml
|
- import_tasks: nova_virt_detect.yml
|
||||||
when:
|
when:
|
||||||
- nova_virt_type is not defined
|
- nova_virt_type is not defined
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
- nova-config
|
- nova-config
|
||||||
|
|
||||||
- include_tasks: nova_vgpu_detect.yml
|
- import_tasks: nova_vgpu_detect.yml
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
- nova-config
|
- nova-config
|
||||||
|
|
||||||
- include_tasks: nova_pre_install.yml
|
- import_tasks: nova_pre_install.yml
|
||||||
tags:
|
tags:
|
||||||
- nova-install
|
- nova-install
|
||||||
|
|
||||||
- include_tasks: nova_install.yml
|
- import_tasks: nova_install.yml
|
||||||
tags:
|
tags:
|
||||||
- nova-install
|
- nova-install
|
||||||
|
|
||||||
@ -96,11 +96,11 @@
|
|||||||
tags:
|
tags:
|
||||||
- nova-config
|
- nova-config
|
||||||
|
|
||||||
- include_tasks: nova_post_install.yml
|
- import_tasks: nova_post_install.yml
|
||||||
tags:
|
tags:
|
||||||
- nova-config
|
- nova-config
|
||||||
|
|
||||||
- include_tasks: nova_service_setup.yml
|
- import_tasks: nova_service_setup.yml
|
||||||
when:
|
when:
|
||||||
- "nova_services['nova-conductor']['group'] in group_names"
|
- "nova_services['nova-conductor']['group'] in group_names"
|
||||||
- "inventory_hostname == ((groups['nova_conductor'] | intersect(ansible_play_hosts)) | list)[0]"
|
- "inventory_hostname == ((groups['nova_conductor'] | intersect(ansible_play_hosts)) | list)[0]"
|
||||||
@ -126,19 +126,19 @@
|
|||||||
- common-mq
|
- common-mq
|
||||||
- nova-config
|
- nova-config
|
||||||
|
|
||||||
- include_tasks: nova_db_setup.yml
|
- import_tasks: nova_db_setup.yml
|
||||||
when:
|
when:
|
||||||
- "nova_services['nova-conductor']['group'] in group_names"
|
- "nova_services['nova-conductor']['group'] in group_names"
|
||||||
- "inventory_hostname == ((groups['nova_conductor'] | intersect(ansible_play_hosts)) | list)[0]"
|
- "inventory_hostname == ((groups['nova_conductor'] | intersect(ansible_play_hosts)) | list)[0]"
|
||||||
tags:
|
tags:
|
||||||
- nova-config
|
- nova-config
|
||||||
|
|
||||||
- include_tasks: nova_uwsgi.yml
|
- import_tasks: nova_uwsgi.yml
|
||||||
tags:
|
tags:
|
||||||
- nova-config
|
- nova-config
|
||||||
|
|
||||||
- name: Run the systemd service role
|
- name: Run the systemd service role
|
||||||
include_role:
|
import_role:
|
||||||
name: systemd_service
|
name: systemd_service
|
||||||
vars:
|
vars:
|
||||||
systemd_user_name: "{{ nova_system_user_name }}"
|
systemd_user_name: "{{ nova_system_user_name }}"
|
||||||
@ -170,14 +170,14 @@
|
|||||||
- nova-config
|
- nova-config
|
||||||
- systemd-service
|
- systemd-service
|
||||||
|
|
||||||
- include_tasks: nova_compute.yml
|
- import_tasks: nova_compute.yml
|
||||||
when:
|
when:
|
||||||
- "nova_services['nova-compute']['group'] in group_names"
|
- "nova_services['nova-compute']['group'] in group_names"
|
||||||
tags:
|
tags:
|
||||||
- nova-compute
|
- nova-compute
|
||||||
|
|
||||||
- name: Include ceph_client role
|
- name: Include ceph_client role
|
||||||
include_role:
|
import_role:
|
||||||
name: ceph_client
|
name: ceph_client
|
||||||
vars:
|
vars:
|
||||||
openstack_service_system_user: "{{ nova_system_user_name }}"
|
openstack_service_system_user: "{{ nova_system_user_name }}"
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
- include_tasks: "drivers/{{ nova_virt_type }}/nova_compute_{{ nova_virt_type }}.yml"
|
- include_tasks: "drivers/{{ nova_virt_type }}/nova_compute_{{ nova_virt_type }}.yml"
|
||||||
|
when:
|
||||||
|
- nova_virt_type != 'ironic'
|
||||||
tags:
|
tags:
|
||||||
- nova-install
|
- nova-install
|
||||||
|
|
||||||
|
@ -45,8 +45,26 @@
|
|||||||
tags:
|
tags:
|
||||||
- nova-pip-packages
|
- nova-pip-packages
|
||||||
|
|
||||||
- name: Install nova packages from PIP
|
- name: Install the python venv
|
||||||
include_tasks: nova_install_source.yml
|
import_role:
|
||||||
|
name: "python_venv_build"
|
||||||
|
vars:
|
||||||
|
venv_build_constraints: "{{ nova_git_constraints }}"
|
||||||
|
venv_build_distro_package_list: "{{ nova_devel_distro_packages }}"
|
||||||
|
venv_install_destination_path: "{{ nova_bin | dirname }}"
|
||||||
|
venv_pip_install_args: "{{ nova_pip_install_args }}"
|
||||||
|
venv_packages_to_symlink: "{{ (nova_services['nova-compute']['group'] in group_names) | ternary(nova_compute_kvm_packages_to_symlink, []) }}"
|
||||||
|
venv_pip_packages: "{{ nova_venv_packages }}"
|
||||||
|
venv_facts_when_changed:
|
||||||
|
- section: "nova"
|
||||||
|
option: "need_service_restart"
|
||||||
|
value: "True"
|
||||||
|
- section: "nova"
|
||||||
|
option: "need_online_data_migrations"
|
||||||
|
value: "True"
|
||||||
|
- section: "nova"
|
||||||
|
option: "venv_tag"
|
||||||
|
value: "{{ nova_venv_tag }}"
|
||||||
when: nova_install_method == 'source'
|
when: nova_install_method == 'source'
|
||||||
|
|
||||||
- include_tasks: "consoles/nova_console_{{ nova_console_type }}_install.yml"
|
- include_tasks: "consoles/nova_console_{{ nova_console_type }}_install.yml"
|
||||||
|
@ -1,59 +0,0 @@
|
|||||||
---
|
|
||||||
# Copyright 2018, SUSE Linux GmbH.
|
|
||||||
#
|
|
||||||
# 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 nova_developer_constraints %}
|
|
||||||
{{ item }}
|
|
||||||
{% endfor %}
|
|
||||||
when:
|
|
||||||
- nova_developer_mode | bool
|
|
||||||
|
|
||||||
- name: Ensure remote wheel building is disabled in developer mode
|
|
||||||
set_fact:
|
|
||||||
venv_build_host: "{{ inventory_hostname }}"
|
|
||||||
when:
|
|
||||||
- nova_developer_mode | bool
|
|
||||||
|
|
||||||
- name: Install the python venv
|
|
||||||
include_role:
|
|
||||||
name: "python_venv_build"
|
|
||||||
vars:
|
|
||||||
venv_build_distro_package_list: "{{ nova_devel_distro_packages }}"
|
|
||||||
venv_install_destination_path: "{{ nova_bin | dirname }}"
|
|
||||||
venv_pip_install_args: "{{ nova_pip_install_args }}"
|
|
||||||
venv_packages_to_symlink: "{{ (nova_services['nova-compute']['group'] in group_names) | ternary(nova_compute_kvm_packages_to_symlink, []) }}"
|
|
||||||
venv_pip_packages: >-
|
|
||||||
{{ nova_pip_packages | union(nova_user_pip_packages) +
|
|
||||||
((nova_services['nova-novncproxy']['group'] in group_names) and (nova_console_type == 'novnc')) | ternary(nova_novnc_pip_packages, []) +
|
|
||||||
(nova_oslomsg_amqp1_enabled | bool) | ternary(nova_optional_oslomsg_amqp1_pip_packages, []) }}
|
|
||||||
venv_facts_when_changed:
|
|
||||||
- section: "nova"
|
|
||||||
option: "need_service_restart"
|
|
||||||
value: "True"
|
|
||||||
- section: "nova"
|
|
||||||
option: "need_online_data_migrations"
|
|
||||||
value: "True"
|
|
||||||
- section: "nova"
|
|
||||||
option: "venv_tag"
|
|
||||||
value: "{{ nova_venv_tag }}"
|
|
@ -13,6 +13,24 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
nova_venv_packages: |-
|
||||||
|
{%- set pkg_list = nova_pip_packages | union(nova_user_pip_packages) %}
|
||||||
|
{%- if nova_oslomsg_amqp1_enabled | bool %}
|
||||||
|
{%- set _ = pkg_list.extend(nova_optional_oslomsg_amqp1_pip_packages) %}
|
||||||
|
{%- endif %}
|
||||||
|
{%- if (nova_services['nova-novncproxy']['group'] in group_names) and
|
||||||
|
(nova_console_type == 'novnc') %}
|
||||||
|
{%- set _ = pkg_list.extend(nova_novnc_pip_packages) %}
|
||||||
|
{%- endif %}
|
||||||
|
{%- if (nova_services['nova-compute']['group'] in group_names) %}
|
||||||
|
{%- if nova_virt_type == 'lxd' %}
|
||||||
|
{%- set _ = pkg_list.extend(nova_compute_lxd_pip_packages) %}
|
||||||
|
{%- elif nova_virt_type == 'ironic' %}
|
||||||
|
{%- set _ = pkg_list.extend(nova_compute_ironic_pip_packages) %}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endif %}
|
||||||
|
{{- pkg_list | unique }}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Compile a list of the services on a host based on whether
|
# Compile a list of the services on a host based on whether
|
||||||
# the host is in the host group and the service is enabled.
|
# the host is in the host group and the service is enabled.
|
||||||
|
Loading…
Reference in New Issue
Block a user