Use service_net_map for ceph_dashboard_vip

Instead of if conditionals on hard-coded network names, use the
ServiceNetMap. CephDashboardNetwork defaults to storage_dashboard
with a fallback to 'ctlplane' in the ServiceNetMap.

This will allow custom network names to be used, via overriding
CephDashboardNetwork in ServiceNetMap or via service_net_map_replace
in network data.

Related-Bug: #1946239
Depends-On: I9a62b2cf24b2dd020de74e18af8c7bc0535d12d9
Change-Id: I145d6c0ddd3cbbfed92113db56e22299ab7c9b08
(cherry picked from commit 3af34f0c68)
This commit is contained in:
Harald Jensås 2021-10-08 13:17:38 +02:00 committed by Francesco Pantano
parent 9409eb922d
commit 78dd878ee5
No known key found for this signature in database
GPG Key ID: 0458D4D1F41BD75C
3 changed files with 3 additions and 7 deletions

View File

@ -191,6 +191,7 @@ provisioner:
barbican_api_network: ctlplane
bindnetwork: ctlplane
ceph_cluster_network: ctlplane
ceph_dashboard_network: ctlplane
ceph_grafana_network: ctlplane
ceph_mon_network: ctlplane
ceph_rgw_network: ctlplane

View File

@ -191,6 +191,7 @@ provisioner:
barbican_api_network: ctlplane
bindnetwork: ctlplane
ceph_cluster_network: ctlplane
ceph_dashboard_network: ctlplane
ceph_grafana_network: ctlplane
ceph_mon_network: ctlplane
ceph_rgw_network: ctlplane

View File

@ -12,10 +12,6 @@
{% set _ = vip_data.__setitem__('internal_api_virtual_ip', (net_vip_map[networks['InternalApi']['name_lower']])) %}
{% endif %}
{% set _ = vip_data.__setitem__('network_virtual_ips', network_virtual_ips) %}
{# when ceph monitoring stack is enabled the frontend vip is explicitly set according to CephDashboardNetwork #}
{% if 'ceph_grafana' in enabled_services %}
{% set _ = vip_data.__setitem__('ceph_dashboard_vip', (net_vip_map[service_net_map['ceph_dashboard_network']])) %}
{% endif %}
{% for network in enabled_networks %}
{% if network == 'StorageNFS' %}
{% set _ = vip_data.__setitem__('ganesha_vip', (net_vip_map[networks['StorageNFS']['name_lower']])) %}
@ -25,10 +21,8 @@
{% set _ = vip_data.__setitem__('ganesha_vip', (net_vip_map[networks['External']['name_lower']])) %}
{% endif %}
{% endif %}
{% if network == 'StorageDashboard' %}
{% set _ = vip_data.__setitem__('ceph_dashboard_vip', (net_vip_map[networks['StorageDashboard']['name_lower']])) %}
{% endif %}
{% endfor %}
{% set _ = vip_data.__setitem__('ceph_dashboard_vip', (net_vip_map[service_net_map['ceph_dashboard_network']])) %}
{# public_virtual_ip and controller_virtual_ip are needed in both HAproxy & keepalived. #}
{% if 'External' in enabled_networks %}
{% set _ = vip_data.__setitem__('tripleo::haproxy::public_virtual_ip', (net_vip_map[networks['External']['name_lower']])) %}