Add VLAN id to ansible group_vars
Read the VLAN id of the subnet tag's and populate the {{network.name_lower}}_vlan_id group var. The VLAN id is added to subnet tags in the depends-on change. Depends-On: https://review.opendev.org/750666 Change-Id: I09233e84e022433220f2fa7b6758368191880566
This commit is contained in:
parent
f4867675c4
commit
f7e35f9fca
@ -961,10 +961,24 @@ resources:
|
|||||||
{{network.name_lower}}_gateway_ip: {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{role.networks[network.name]['subnet']}}, gateway_ip]}
|
{{network.name_lower}}_gateway_ip: {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{role.networks[network.name]['subnet']}}, gateway_ip]}
|
||||||
{{network.name_lower}}_host_routes: {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{role.networks[network.name]['subnet']}}, host_routes]}
|
{{network.name_lower}}_host_routes: {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{role.networks[network.name]['subnet']}}, host_routes]}
|
||||||
{{network.name_lower}}_cidr: {str_split: ['/', {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{role.networks[network.name]['subnet']}}, cidr]}, 1]}
|
{{network.name_lower}}_cidr: {str_split: ['/', {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{role.networks[network.name]['subnet']}}, cidr]}, 1]}
|
||||||
|
{{network.name_lower}}_vlan_id:
|
||||||
|
yaql:
|
||||||
|
expression: >
|
||||||
|
switch(not isList($.data) => 1,
|
||||||
|
not $.data.where($.startsWith('tripleo_vlan_id')).len() => 1,
|
||||||
|
true => int($.data.where($.startsWith('tripleo_vlan_id')).first().split('=').last()))
|
||||||
|
data: {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{role.networks[network.name]['subnet']}}, tags]}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{{network.name_lower}}_gateway_ip: {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{network.name_lower}}_subnet, gateway_ip]}
|
{{network.name_lower}}_gateway_ip: {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{network.name_lower}}_subnet, gateway_ip]}
|
||||||
{{network.name_lower}}_host_routes: {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{network.name_lower}}_subnet, host_routes]}
|
{{network.name_lower}}_host_routes: {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{network.name_lower}}_subnet, host_routes]}
|
||||||
{{network.name_lower}}_cidr: {str_split: ['/', {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{network.name_lower}}_subnet, cidr]}, 1]}
|
{{network.name_lower}}_cidr: {str_split: ['/', {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{network.name_lower}}_subnet, cidr]}, 1]}
|
||||||
|
{{network.name_lower}}_vlan_id:
|
||||||
|
yaql:
|
||||||
|
expression: >
|
||||||
|
switch(not isList($.data) => 1,
|
||||||
|
not $.data.where($.startsWith('tripleo_vlan_id')).len() => 1,
|
||||||
|
true => int($.data.where($.startsWith('tripleo_vlan_id')).first().split('=').last()))
|
||||||
|
data: {get_attr: [Networks, net_attributes_map, {{network.name_lower}}, subnets, {{network.name_lower}}_subnet, tags]}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
network_cidrs:
|
network_cidrs:
|
||||||
@ -991,8 +1005,7 @@ resources:
|
|||||||
default_route_networks: {{role.default_route_networks}}
|
default_route_networks: {{role.default_route_networks}}
|
||||||
networks_skip_config: {{role.networks_skip_config }}
|
networks_skip_config: {{role.networks_skip_config }}
|
||||||
role_tags: {{role.tags}}
|
role_tags: {{role.tags}}
|
||||||
|
{%- endfor %}
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
ControlVirtualIP:
|
ControlVirtualIP:
|
||||||
depends_on: ServiceNetMap
|
depends_on: ServiceNetMap
|
||||||
|
Loading…
Reference in New Issue
Block a user