Jonathan Rosser a0714bf9a9 Simplify handling of 'telemetry' scenario in CI tests
Reduce the amount of logic in the pre-gate-scenario playbook and
keep it all together in the bootstrap-host role.

Change-Id: I83fda9cfceabb14c2fb471059a76a8add6714b72
2024-08-13 14:16:00 +01:00

80 lines
3.3 KiB
YAML

---
# 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.
bootstrap_host_scenarios: "{{ (bootstrap_host_scenario.split('_') | reject('equalto', '')) | list }}"
_lxc_container_backing_store: |-
{% if 'zfs' in bootstrap_host_scenarios %}
{% set store = 'zfs' %}
{% elif 'btrfs' in bootstrap_host_scenarios %}
{% set store = 'btrfs' %}
{% elif 'dir' in bootstrap_host_scenarios %}
{% set store = 'dir' %}
{% elif 'lvm' in bootstrap_host_scenarios %}
{% set store = 'lvm' %}
{% elif 'overlayfs' in bootstrap_host_scenarios %}
{% set store = 'overlayfs' %}
{% else %}
{% set store = 'dir' %}
{% endif %}
{{ store }}
# Expand the scenario list to include specific services that are being deployed
# as part of the scenario
bootstrap_host_scenarios_expanded: |-
{# Keystone is included in every scenario #}
{% set scenario_list = bootstrap_host_scenarios + ['keystone', 'haproxy'] %}
{% if ['aio', 'translations'] | intersect(bootstrap_host_scenarios) | length > 0 %}
{# Base services deployed with aio and translations scenarios #}
{% set _ = scenario_list.extend(['cinder', 'glance', 'neutron', 'nova', 'placement', 'horizon']) %}
{% endif %}
{# Service additions based on scenario presence #}
{% if 'cloudkitty' in bootstrap_host_scenarios %}
{% set _ = scenario_list.extend(['ceilometer', 'gnocchi']) %}
{% endif %}
{% if 'designate' in bootstrap_host_scenarios or
('validate' in bootstrap_host_scenarios and ('integrated' in bootstrap_host_scenarios or 'plugins' in bootstrap_host_scenarios)) %}
{% set _ = scenario_list.extend(['zookeeper']) %}
{% endif %}
{% if 'ironic' in bootstrap_host_scenarios %}
{% set _ = scenario_list.extend(['swift']) %}
{% endif %}
{% if ('magnum' in bootstrap_host_scenarios) or ('sahara' in bootstrap_host_scenarios) %}
{% set _ = scenario_list.extend(['heat']) %}
{% endif %}
{% if 'manila' in bootstrap_host_scenarios %}
{% set _ = scenario_list.extend(['ceph']) %}
{% endif %}
{% if 'murano' in bootstrap_host_scenarios %}
{% set _ = scenario_list.extend(['heat']) %}
{% endif %}
{% if ['telemetry', 'aodh', 'ceilometer', 'gnocchi'] | intersect(bootstrap_host_scenarios) | length > 0 %}
{% set _ = scenario_list.extend(['aodh', 'ceilometer', 'gnocchi']) %}
{% endif %}
{% if 'translations' in bootstrap_host_scenarios %}
{% set _ = scenario_list.extend(['designate', 'heat', 'magnum', 'sahara', 'swift', 'trove']) %}
{% endif %}
{{ (scenario_list | unique) | sort }}
_neutron_plugin_driver: |-
{% if 'lxb' in bootstrap_host_scenarios_expanded %}
{% set plugin = 'ml2.lxb' %}
{% elif 'ovs' in bootstrap_host_scenarios_expanded %}
{% set plugin = 'ml2.ovs' %}
{% else %}
{% set plugin = 'ml2.ovn' %}
{% endif %}
{{ plugin }}