From 6fc91a9657cb734ebb1249b4713ed6957c955d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Jens=C3=A5s?= Date: Fri, 8 Oct 2021 13:13:22 +0200 Subject: [PATCH] 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 2894ef9d3e4208ee967b8eed8ccc7bef268414cd) (cherry picked from commit dc7f164ffa0c36b0c0f660d69bd1ab3b5ede63fa) --- .../roles/tripleo_hieradata/templates/vip_data.j2 | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/tripleo_ansible/roles/tripleo_hieradata/templates/vip_data.j2 b/tripleo_ansible/roles/tripleo_hieradata/templates/vip_data.j2 index 668b28cb0..66b44143c 100644 --- a/tripleo_ansible/roles/tripleo_hieradata/templates/vip_data.j2 +++ b/tripleo_ansible/roles/tripleo_hieradata/templates/vip_data.j2 @@ -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 %}