Clean up bootstrap-aio scenario configuration
A light refactor to make the scenario string into a list and make the jinja service list generator more readable. Change-Id: I7fc05f219d88a1c115566a3991bac8f0827b6f1b
This commit is contained in:
parent
463d25ee0d
commit
c14fc6d0ee
@ -182,7 +182,7 @@
|
|||||||
src: "{{ playbook_dir }}/../etc/openstack_deploy/env.d/aio_metal.yml.example"
|
src: "{{ playbook_dir }}/../etc/openstack_deploy/env.d/aio_metal.yml.example"
|
||||||
dest: "/etc/openstack_deploy/env.d/aio_metal.yml"
|
dest: "/etc/openstack_deploy/env.d/aio_metal.yml"
|
||||||
when:
|
when:
|
||||||
- "bootstrap_host_scenario is search('metal')"
|
- "'metal' in bootstrap_host_scenarios"
|
||||||
|
|
||||||
- name: Create vars override folders if we need to test them
|
- name: Create vars override folders if we need to test them
|
||||||
file:
|
file:
|
||||||
|
@ -13,43 +13,47 @@
|
|||||||
# 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.
|
||||||
|
|
||||||
bootstrap_host_special_word_list:
|
bootstrap_host_scenarios: "{{ (bootstrap_host_scenario.split('_') | reject('equalto', '')) | list }}"
|
||||||
- aio
|
|
||||||
- distro
|
|
||||||
- lxc
|
|
||||||
- metal
|
|
||||||
- nspawn
|
|
||||||
- octaviav2
|
|
||||||
- proxy
|
|
||||||
- source
|
|
||||||
- telemetry
|
|
||||||
- translations
|
|
||||||
- varstest
|
|
||||||
|
|
||||||
bootstrap_host_services: >-
|
_non_service_scenarios:
|
||||||
{%- set scenario_list = (bootstrap_host_scenario.split('_') | reject('equalto', '')) | list %}
|
- aio
|
||||||
{%- set service_list = ['keystone'] %}
|
- distro
|
||||||
{%- set service_list_extra = scenario_list | difference(bootstrap_host_special_word_list) %}
|
- lxc
|
||||||
{%- if 'metal' not in scenario_list %}
|
- metal
|
||||||
{%- set _ = service_list.append('haproxy') %}
|
- nspawn
|
||||||
{%- endif %}
|
- octaviav2
|
||||||
{%- if 'aio' in scenario_list or 'translations' in scenario_list %}
|
- proxy
|
||||||
{%- set _ = service_list.extend(['cinder', 'glance', 'neutron', 'nova', 'placement']) %}
|
- source
|
||||||
{%- if 'metal' not in scenario_list %}
|
- telemetry
|
||||||
{%- set _ = service_list.append('horizon') %}
|
- translations
|
||||||
{%- endif %}
|
- varstest
|
||||||
{%- endif %}
|
|
||||||
{%- if 'ironic' in scenario_list %}
|
bootstrap_host_services: |-
|
||||||
{%- set _ = service_list.extend(['swift']) %}
|
{% set service_list = ['keystone'] %}
|
||||||
{%- endif %}
|
{% set service_list_extra = bootstrap_host_scenarios | difference(_non_service_scenarios) %}
|
||||||
{%- if 'octaviav2' in scenario_list %}
|
{% if 'metal' not in bootstrap_host_scenarios %}
|
||||||
{%- set _ = service_list.extend(['octavia']) %}
|
{% set _ = service_list.append('haproxy') %}
|
||||||
{%- endif %}
|
{% endif %}
|
||||||
{%- if 'telemetry' in scenario_list %}
|
{% if ['aio', 'translations'] | intersect(bootstrap_host_scenarios) | length > 0 %}
|
||||||
{%- set _ = service_list.extend(['aodh', 'ceilometer', 'gnocchi', 'panko']) %}
|
{# Base services deployed with aio and translations scenarios #}
|
||||||
{%- endif %}
|
{% set _ = service_list.extend(['cinder', 'glance', 'neutron', 'nova', 'placement']) %}
|
||||||
{%- if 'translations' in scenario_list %}
|
{% if 'metal' not in bootstrap_host_scenarios %}
|
||||||
{%- set _ = service_list.extend(['designate', 'heat', 'magnum', 'sahara', 'swift', 'trove']) %}
|
{# Horizon is a base service in container jobs #}
|
||||||
{%- endif %}
|
{% set _ = service_list.append('horizon') %}
|
||||||
{%- set _ = service_list.extend(service_list_extra) %}
|
{% endif %}
|
||||||
{{- (service_list | unique) | sort }}
|
{% endif %}
|
||||||
|
{# Service additions based on scenario presence #}
|
||||||
|
{% if 'ironic' in bootstrap_host_scenarios %}
|
||||||
|
{% set _ = service_list.extend(['swift']) %}
|
||||||
|
{% endif %}
|
||||||
|
{% if 'octaviav2' in bootstrap_host_scenarios %}
|
||||||
|
{% set _ = service_list.extend(['octavia']) %}
|
||||||
|
{% endif %}
|
||||||
|
{% if 'telemetry' in bootstrap_host_scenarios %}
|
||||||
|
{% set _ = service_list.extend(['aodh', 'ceilometer', 'gnocchi', 'panko']) %}
|
||||||
|
{% endif %}
|
||||||
|
{% if 'translations' in bootstrap_host_scenarios %}
|
||||||
|
{% set _ = service_list.extend(['designate', 'heat', 'magnum', 'sahara', 'swift', 'trove']) %}
|
||||||
|
{% endif %}
|
||||||
|
{% set _ = service_list.extend(service_list_extra) %}
|
||||||
|
{{ (service_list | unique) | sort }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user