Network names are always fixed. Not sure what's the issue you've.
If you've network data as below
...
- name: InternalApi vip: true name_lower: internal_api_cloud_0 service_net_map_replace: internal_api subnets: internal_api_cloud_0_subnet: ip_subnet: '172.16.13.0/24' allocation_pools: [{'start': '172.16.13.4', 'end': '172.16.13.250'}] vlan: 13
Then
{%- if 'InternalApi' in role.networks %} {{role.name}}HostnameResolveNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }} {{role.name}}MetricsQdrNetwork: {{ _service_nets.get('internal_api', 'ctlplane') }} {%- else %} {{role.name}}HostnameResolveNetwork: ctlplane {{role.name}}MetricsQdrNetwork: ctlplane {%- endif %}
would return
{{role.name}}HostnameResolveNetwork: internal_api_cloud_0 {{role.name}}MetricsQdrNetwork: internal_api_cloud_0
Network names are always fixed. Not sure what's the issue you've.
If you've network data as below
...
- name: InternalApi api_cloud_ 0 net_map_ replace: internal_api api_cloud_ 0_subnet: n_pools: [{'start': '172.16.13.4', 'end': '172.16.13.250'}]
vip: true
name_lower: internal_
service_
subnets:
internal_
ip_subnet: '172.16.13.0/24'
allocatio
vlan: 13
...
Then
{%- if 'InternalApi' in role.networks %} name}}HostnameR esolveNetwork: {{ _service_ nets.get( 'internal_ api', 'ctlplane') }} name}}MetricsQd rNetwork: {{ _service_ nets.get( 'internal_ api', 'ctlplane') }} name}}HostnameR esolveNetwork: ctlplane name}}MetricsQd rNetwork: ctlplane
{{role.
{{role.
{%- else %}
{{role.
{{role.
{%- endif %}
would return
{{role. name}}HostnameR esolveNetwork: internal_ api_cloud_ 0 name}}MetricsQd rNetwork: internal_ api_cloud_ 0
{{role.