From 66d0dc7626656457b259a142c06bf8428a00c0b5 Mon Sep 17 00:00:00 2001 From: Andrew Bonney Date: Fri, 4 Aug 2023 08:42:51 +0100 Subject: [PATCH] Enable multiple console proxies when required in deployments When Nova is deployed with a mix of x86 and arm systems (for example), it may be necessary to deploy both 'novnc' and 'serialconsole' proxy services on the same host in order to service the mixed compute estate. This patch introduces a list which defines the required proxy console types. Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_nova/+/890521 Change-Id: I5ed49878c192516a504a4a77902271214800c5b8 --- inventory/group_vars/all/nova.yml | 6 ++++-- inventory/group_vars/nova_all/haproxy_service.yml | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/inventory/group_vars/all/nova.yml b/inventory/group_vars/all/nova.yml index 2d58af18fa..988108b04f 100644 --- a/inventory/group_vars/all/nova.yml +++ b/inventory/group_vars/all/nova.yml @@ -23,5 +23,7 @@ nova_spice_html5proxy_base_port: 6082 nova_novncproxy_port: 6080 nova_serialconsoleproxy_port: 6083 -# Default nova console type -nova_console_type: "{{ (ansible_facts['architecture'] == 'aarch64') | ternary('serialconsole', 'novnc') }}" \ No newline at end of file +# Default nova console proxy types +nova_console_proxy_types: + - "{{ nova_console_type | default((ansible_facts['architecture'] == 'aarch64') | ternary('serialconsole', 'novnc')) }}" + - "{{ ironic_console_type }}" diff --git a/inventory/group_vars/nova_all/haproxy_service.yml b/inventory/group_vars/nova_all/haproxy_service.yml index 37b19b57d2..520cc7e14c 100644 --- a/inventory/group_vars/nova_all/haproxy_service.yml +++ b/inventory/group_vars/nova_all/haproxy_service.yml @@ -70,7 +70,7 @@ haproxy_nova_spice_console_service: haproxy_backend_ssl: "{{ nova_backend_ssl | default(openstack_service_backend_ssl) }}" haproxy_backend_ca: "{{ nova_haproxy_backend_ca | default(openstack_haproxy_backend_ca) }}" haproxy_accept_both_protocols: "{{ nova_accept_both_protocols | default(openstack_service_accept_both_protocols) }}" - haproxy_service_enabled: "{{ groups['nova_console'] is defined and groups['nova_console'] | length > 0 and nova_console_type == 'spice' }}" + haproxy_service_enabled: "{{ groups['nova_console'] is defined and groups['nova_console'] | length > 0 and 'spice' in nova_console_proxy_types }}" haproxy_nova_serial_console_service: haproxy_service_name: nova_serial_console @@ -86,8 +86,8 @@ haproxy_nova_serial_console_service: haproxy_backend_ssl: "{{ nova_backend_ssl | default(openstack_service_backend_ssl) }}" haproxy_backend_ca: "{{ nova_haproxy_backend_ca | default(openstack_haproxy_backend_ca) }}" haproxy_accept_both_protocols: "{{ nova_accept_both_protocols | default(openstack_service_accept_both_protocols) }}" - haproxy_service_enabled: "{{ (groups['nova_console'] is defined and groups['nova_console'] | length > 0 and nova_console_type == 'serialconsole') or - (groups['ironic_console'] is defined and groups['ironic_console'] | length > 0 and ironic_console_type == 'serialconsole') }}" + haproxy_service_enabled: "{{ (groups['nova_console'] is defined and groups['nova_console'] | length > 0 and 'serialconsole' in nova_console_proxy_types) or + (groups['ironic_console'] is defined and groups['ironic_console'] | length > 0 and 'serialconsole' in nova_console_proxy_types) }}" haproxy_nova_novnc_console_service: haproxy_service_name: nova_novnc_console @@ -103,7 +103,7 @@ haproxy_nova_novnc_console_service: haproxy_backend_ssl: "{{ nova_backend_ssl | default(openstack_service_backend_ssl) }}" haproxy_backend_ca: "{{ nova_haproxy_backend_ca | default(openstack_haproxy_backend_ca) }}" haproxy_accept_both_protocols: "{{ nova_accept_both_protocols | default(openstack_service_accept_both_protocols) }}" - haproxy_service_enabled: "{{ groups['nova_console'] is defined and groups['nova_console'] | length > 0 and nova_console_type == 'novnc' }}" + haproxy_service_enabled: "{{ groups['nova_console'] is defined and groups['nova_console'] | length > 0 and 'novnc' in nova_console_proxy_types }}" # NOTE(jrosser) Clean up legacy console haproxy configs from previous releases haproxy_nova_console_service: