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"
|
||||
dest: "/etc/openstack_deploy/env.d/aio_metal.yml"
|
||||
when:
|
||||
- "bootstrap_host_scenario is search('metal')"
|
||||
- "'metal' in bootstrap_host_scenarios"
|
||||
|
||||
- name: Create vars override folders if we need to test them
|
||||
file:
|
||||
|
@ -13,7 +13,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
bootstrap_host_special_word_list:
|
||||
bootstrap_host_scenarios: "{{ (bootstrap_host_scenario.split('_') | reject('equalto', '')) | list }}"
|
||||
|
||||
_non_service_scenarios:
|
||||
- aio
|
||||
- distro
|
||||
- lxc
|
||||
@ -26,30 +28,32 @@ bootstrap_host_special_word_list:
|
||||
- translations
|
||||
- varstest
|
||||
|
||||
bootstrap_host_services: >-
|
||||
{%- set scenario_list = (bootstrap_host_scenario.split('_') | reject('equalto', '')) | list %}
|
||||
{%- set service_list = ['keystone'] %}
|
||||
{%- set service_list_extra = scenario_list | difference(bootstrap_host_special_word_list) %}
|
||||
{%- if 'metal' not in scenario_list %}
|
||||
{%- set _ = service_list.append('haproxy') %}
|
||||
{%- endif %}
|
||||
{%- if 'aio' in scenario_list or 'translations' in scenario_list %}
|
||||
{%- set _ = service_list.extend(['cinder', 'glance', 'neutron', 'nova', 'placement']) %}
|
||||
{%- if 'metal' not in scenario_list %}
|
||||
{%- set _ = service_list.append('horizon') %}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- if 'ironic' in scenario_list %}
|
||||
{%- set _ = service_list.extend(['swift']) %}
|
||||
{%- endif %}
|
||||
{%- if 'octaviav2' in scenario_list %}
|
||||
{%- set _ = service_list.extend(['octavia']) %}
|
||||
{%- endif %}
|
||||
{%- if 'telemetry' in scenario_list %}
|
||||
{%- set _ = service_list.extend(['aodh', 'ceilometer', 'gnocchi', 'panko']) %}
|
||||
{%- endif %}
|
||||
{%- if 'translations' in scenario_list %}
|
||||
{%- set _ = service_list.extend(['designate', 'heat', 'magnum', 'sahara', 'swift', 'trove']) %}
|
||||
{%- endif %}
|
||||
{%- set _ = service_list.extend(service_list_extra) %}
|
||||
{{- (service_list | unique) | sort }}
|
||||
bootstrap_host_services: |-
|
||||
{% set service_list = ['keystone'] %}
|
||||
{% set service_list_extra = bootstrap_host_scenarios | difference(_non_service_scenarios) %}
|
||||
{% if 'metal' not in bootstrap_host_scenarios %}
|
||||
{% set _ = service_list.append('haproxy') %}
|
||||
{% endif %}
|
||||
{% if ['aio', 'translations'] | intersect(bootstrap_host_scenarios) | length > 0 %}
|
||||
{# Base services deployed with aio and translations scenarios #}
|
||||
{% set _ = service_list.extend(['cinder', 'glance', 'neutron', 'nova', 'placement']) %}
|
||||
{% if 'metal' not in bootstrap_host_scenarios %}
|
||||
{# Horizon is a base service in container jobs #}
|
||||
{% set _ = service_list.append('horizon') %}
|
||||
{% endif %}
|
||||
{% 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