diff --git a/network/network.j2 b/network/network.j2 index 2cd45f99aa..5dbf7546be 100644 --- a/network/network.j2 +++ b/network/network.j2 @@ -178,6 +178,8 @@ resources: - {get_param: {{network.name}}NetValueSpecs} - {'mtu': {get_param: {{network.name}}Mtu}} tags: + - tripleo_net_idx={{network.idx}} + - tripleo_network_name={{network.name}} - tripleo_vip={{network.vip|default(false)}} {%- if network.service_net_map_replace|default('') %} - tripleo_service_net_map_replace={{network.service_net_map_replace}} diff --git a/tools/process-templates.py b/tools/process-templates.py index 7eafcc4774..208303a0c2 100755 --- a/tools/process-templates.py +++ b/tools/process-templates.py @@ -158,6 +158,11 @@ def process_templates(template_path, role_data_path, output_dir, if network_data is None: network_data = [] + # Set internal network index key for each network, network resources + # are created with a tag tripleo_net_idx + for idx, net in enumerate(network_data): + network_data[idx].update({'idx': idx}) + j2_excludes = {} j2_excludes_path = os.path.join(template_path, 'j2_excludes.yaml') if os.path.exists(j2_excludes_path):