Use service_net_map for ganesha_vip

Instead of if conditionals on hard-coded network names, use the
ServiceNetMap. GaneshaNetwork defaults to 'storage_nfs' with a
fallback to 'external' and then to 'ctlplane' in the ServiceNetMap.

This will allow custom network names to be used,
either via overriding GaneshaNetwork in ServiceNetMap or using the
service_net_map_replace in network data.

Related-Bug: #1946239
Change-Id: Ic7743e7cd640703d166aecd97f59cbaf11c65500
(cherry picked from commit 2894ef9d3e)
(cherry picked from commit dc7f164ffa)
This commit is contained in:
Harald Jensås 2021-10-08 13:13:22 +02:00 committed by Tom Barron
parent 8fe6abb67c
commit 6fc91a9657
1 changed files with 1 additions and 10 deletions

View File

@ -12,16 +12,7 @@
{% 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) %}
{% for network in enabled_networks %}
{% if network == 'StorageNFS' %}
{% set _ = vip_data.__setitem__('ganesha_vip', (net_vip_map[networks['StorageNFS']['name_lower']])) %}
{% endif %}
{% if not vip_data.ganesha_vip is defined %}
{% if 'External' in enabled_networks %}
{% set _ = vip_data.__setitem__('ganesha_vip', (net_vip_map[networks['External']['name_lower']])) %}
{% endif %}
{% endif %}
{% endfor %}
{% set _ = vip_data.__setitem__('ganesha_vip', (net_vip_map[service_net_map['ganesha_network']])) %}
{% 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 %}