commit 1be92c1c18016b626a51c96358371c671ac457f7 Author: Harald Jensås Date: Tue Sep 22 14:28:37 2020 +0200 Cleanup NetworkConfig after moving to role-level * Clean up port resoures outputs that is no longer required since we get it of the network attributes map instead. The removed outputs are mtu, host_routes, gateway_ip, cidr * Drop usage of parameter ``ControlPlaneSubnetCidr`` in overcloud.yaml, get it from net_attributes_map instead, * Remove old notes regarding parameters we don't need to set in network-environment files. * Remove DnsServers from network-environment files. Nameservers should be defined in undercloud.conf, either globally with undercloud_nameservers, or per-control plane subnet using the dns_nameservers option in the subnet group. (I don't think we can deprecate the param entirely, cause standalone ...) Change-Id: I31154448603ccbba692282c44511d963ca9b6d0e diff --git a/environments/network-environment-v6-all.j2.yaml b/environments/network-environment-v6-all.j2.yaml index cca2a89..6e6df2a 100644 --- a/environments/network-environment-v6-all.j2.yaml +++ b/environments/network-environment-v6-all.j2.yaml @@ -14,16 +14,6 @@ resource_registry: parameter_defaults: # This section is where deployment-specific configuration is done # - # NOTE: (Since Rocky) - # ControlPlaneSubnetCidr: It is no longer a requirement to provide this - # parameter. The attribute is resolved from the - # ctlplane subnet(s). - # ControlPlaneDefaultRoute: It is no longer a requirement to provide this - # parameter. The attribute is resolved from the - # ctlplane subnet(s). - # EC2MetadataIp: It is no longer a requirement to provide this parameter. The - # attribute is resolved from the ctlplane subnet(s). - # # {% for network in networks if network.enabled|default(true) %} # Customize the IP subnets to match the local environment @@ -47,10 +37,6 @@ parameter_defaults: {%- endif %} {% endfor %} {#- FIXME: These global parameters should be defined in a YAML file, e.g. network_data.yaml. #} - # Define the DNS servers (maximum 2) for the overcloud nodes - # When the list is not set (empty) the nameservers on the ctlplane subnet(s) will be used. - # (ctlplane subnet(s) nameservers are confgured by the ``undercloud_nameservers`` option in ``undercloud.conf``) - DnsServers: [] # List of Neutron network types for tenant networks (will be used in order) NeutronNetworkType: 'geneve,vlan' # Neutron VLAN ranges per network, for example 'datacentre:1:499,tenant:500:1000': diff --git a/environments/network-environment-v6.j2.yaml b/environments/network-environment-v6.j2.yaml index a95461a..cddec12 100644 --- a/environments/network-environment-v6.j2.yaml +++ b/environments/network-environment-v6.j2.yaml @@ -17,17 +17,6 @@ resource_registry: parameter_defaults: # This section is where deployment-specific configuration is done # - # NOTE: (Since Rocky) - # ControlPlaneSubnetCidr: It is no longer a requirement to provide this - # parameter. The attribute is resolved from the - # ctlplane subnet(s). - # ControlPlaneDefaultRoute: It is no longer a requirement to provide this - # parameter. The attribute is resolved from the - # ctlplane subnet(s). - # EC2MetadataIp: It is no longer a requirement to provide this parameter. The - # attribute is resolved from the ctlplane subnet(s). - # - # {% for network in networks if network.enabled|default(true) %} {%- if network.name != 'Tenant' %} # Customize the IP subnets to match the local environment @@ -90,10 +79,6 @@ parameter_defaults: {% endfor %} {% endfor %} {#- FIXME: These global parameters should be defined in a YAML file, e.g. network_data.yaml. #} - # Define the DNS servers (maximum 2) for the overcloud nodes - # When the list is not set (empty) the nameservers on the ctlplane subnet(s) will be used. - # (ctlplane subnet(s) nameservers are confgured by the ``undercloud_nameservers`` option in ``undercloud.conf``) - DnsServers: [] # List of Neutron network types for tenant networks (will be used in order) NeutronNetworkType: 'geneve,vlan' # Neutron VLAN ranges per network, for example 'datacentre:1:499,tenant:500:1000': diff --git a/environments/network-environment.j2.yaml b/environments/network-environment.j2.yaml index 60a23c2..8bbe577 100644 --- a/environments/network-environment.j2.yaml +++ b/environments/network-environment.j2.yaml @@ -13,16 +13,6 @@ resource_registry: parameter_defaults: # This section is where deployment-specific configuration is done # - # NOTE: (Since Rocky) - # ControlPlaneSubnetCidr: It is no longer a requirement to provide the - # parameter. The attribute is resolved from the - # ctlplane subnet(s). - # ControlPlaneDefaultRoute: It is no longer a requirement to provide this - # parameter. The attribute is resolved from the - # ctlplane subnet(s). - # EC2MetadataIp: It is no longer a requirement to provide this parameter. The - # attribute is resolved from the ctlplane subnet(s). - # {% for network in networks if network.enabled|default(true) %} # Customize the IP subnet to match the local environment {%- if network.ipv6|default(false) %} @@ -84,10 +74,6 @@ parameter_defaults: {% endfor %} {% endfor %} {#- FIXME: These global parameters should be defined in a YAML file, e.g. network_data.yaml. #} - # Define the DNS servers (maximum 2) for the overcloud nodes - # When the list is not set or empty, the nameservers on the ctlplane subnets will be used. - # (ctlplane subnets nameservers are controlled by the ``undercloud_nameservers`` option in ``undercloud.conf``) - DnsServers: [] # List of Neutron network types for tenant networks (will be used in order) NeutronNetworkType: 'geneve,vlan' # Neutron VLAN ranges per network, for example 'datacentre:1:499,tenant:500:1000': diff --git a/network/ports/ctlplane_vip.yaml b/network/ports/ctlplane_vip.yaml index 1f6a3b8..d0f527b 100644 --- a/network/ports/ctlplane_vip.yaml +++ b/network/ports/ctlplane_vip.yaml @@ -89,7 +89,3 @@ outputs: - - {get_attr: [VipPort, fixed_ips, 0, ip_address]} - '/' - {str_split: ['/', {get_attr: [VipPort, subnets, 0, cidr]}, 1]} - host_routes: - description: Host routes of the ports subnet - value: - get_attr: [VipPort, subnets, 0, host_routes] diff --git a/network/ports/noop.yaml b/network/ports/noop.yaml index 5ad47dd..e3d6a64 100644 --- a/network/ports/noop.yaml +++ b/network/ports/noop.yaml @@ -79,16 +79,3 @@ outputs: - - {get_param: ControlPlaneIP} - '/' - {get_param: ControlPlaneSubnetCidr} - host_routes: # Here for compatibility - description: Host routes of the ports subnet - value: [] - mtu: - description: The maximum transmission unit (MTU) - value: - get_param: ControlPlaneMtu - gateway_ip: # Here for compatibility - description: Gateway IP of the ports subnet - value: '' - cidr: - description: CIDR of the ports subnet - value: {get_param: ControlPlaneSubnetCidr} diff --git a/network/ports/port.j2 b/network/ports/port.j2 index 7e7adcc..0ed3a91 100644 --- a/network/ports/port.j2 +++ b/network/ports/port.j2 @@ -103,19 +103,3 @@ outputs: - - {get_attr: [{{network.name}}Port, fixed_ips, 0, ip_address]} - '/' - {str_split: ['/', {get_attr: [{{network.name}}Port, subnets, 0, cidr]}, 1]} - host_routes: - description: Host routes of the ports subnet - value: - get_attr: [{{network.name}}Port, subnets, 0, host_routes] - mtu: - description: The maximum transmission unit (MTU) - value: - get_attr: [{{network.name}}Port, network, mtu] - gateway_ip: - description: Gateway IP of the ports subnet - value: - get_attr: [{{network.name}}Port, subnets, 0, gateway_ip] - cidr: - description: CIDR of the ports subnet - value: - str_split: ['/', {get_attr: [{{network.name}}Port, subnets, 0, cidr]}, 1] diff --git a/network/ports/port_from_pool.j2 b/network/ports/port_from_pool.j2 index c60a933..748eba6 100644 --- a/network/ports/port_from_pool.j2 +++ b/network/ports/port_from_pool.j2 @@ -60,17 +60,6 @@ parameters: {%- endif %} description: Cidr for the {{network.name_lower}} network. type: string - {{network.name}}InterfaceDefaultRoute: - default: '' - description: default route for the {{network.name_lower}} network - type: string - -conditions: - {{network.name_lower}}_interface_default_route_set: - not: - equals: - - {get_param: {{network.name}}InterfaceDefaultRoute} - - '' outputs: ip_address: @@ -93,21 +82,3 @@ outputs: - - {get_param: [IPPool, {get_param: {{network.name}}NetName}, {get_param: NodeIndex}]} - '/' - {str_split: ['/', {get_param: {{network.name}}NetCidr}, 1]} - host_routes: - description: Host routes of the ports subnet - value: {{network.routes|default([])}} - mtu: - description: The maximum transmission unit (MTU) - value: {{network.mtu|default('1500')}} - gateway_ip: - description: Gateway IP of the ports subnet - value: - if: - - {{network.name_lower}}_interface_default_route_set - - {get_param: {{network.name}}InterfaceDefaultRoute} - - -{%- if network.ipv6|default(false) and network.gateway_ipv6|default(false) %} - {{network.gateway_ipv6|default('')}} -{%- else %} - {{network.gateway_ip|default('')}} -{%- endif %} diff --git a/network/ports/vip.yaml b/network/ports/vip.yaml index 97c8e6f..64fd745 100644 --- a/network/ports/vip.yaml +++ b/network/ports/vip.yaml @@ -96,7 +96,3 @@ outputs: - - {get_attr: [VipPort, fixed_ips, 0, ip_address]} - '/' - {str_split: ['/', {get_attr: [VipPort, subnets, 0, cidr]}, 1]} - host_routes: - description: Host routes of the ports subnet - value: - get_attr: [VipPort, subnets, 0, host_routes] diff --git a/network/ports/vip_v6.yaml b/network/ports/vip_v6.yaml index c5c071f..4295655 100644 --- a/network/ports/vip_v6.yaml +++ b/network/ports/vip_v6.yaml @@ -96,7 +96,3 @@ outputs: - - {get_attr: [VipPort, fixed_ips, 0, ip_address]} - '/' - {str_split: ['/', {get_attr: [VipPort, subnets, 0, cidr]}, 1]} - host_routes: - description: Host routes of the ports subnet - value: - get_attr: [VipPort, subnets, 0, host_routes] diff --git a/network/service_net_map.j2.yaml b/network/service_net_map.j2.yaml index 3cf34de..a4b9ffb 100644 --- a/network/service_net_map.j2.yaml +++ b/network/service_net_map.j2.yaml @@ -131,6 +131,7 @@ parameters: {%- for network in networks if network.vip|default(false) %} {{network.name}}: {{network.name_lower}}_subnet {%- endfor %} + # FIXME(hjensas): This will return the same value no matter what ... redis: {{ _service_nets.get('internal_api', 'internal_api') }}_subnet ovn_dbs: {{ _service_nets.get('internal_api', 'internal_api') }}_subnet type: json diff --git a/overcloud.j2.yaml b/overcloud.j2.yaml index e690260..8a482b0 100644 --- a/overcloud.j2.yaml +++ b/overcloud.j2.yaml @@ -401,9 +401,6 @@ parameter_groups: conditions: add_vips_to_etc_hosts: {equals : [{get_param: AddVipsToEtcHosts}, True]} control_fixed_ip_not_set: {equals : [{get_param: ControlFixedIPs}, []]} - ctlplane_subnet_cidr_set: - not: - equals: [{get_param: ControlPlaneSubnetCidr}, ''] {%- for network in networks if network.name != 'External' %} {{network.name_lower}}_virtual_fixed_ip_set: not: @@ -1068,11 +1065,7 @@ resources: type: OS::TripleO::Network::Ports::RedisVipPort properties: ControlPlaneIP: {get_attr: [ControlVirtualIP, fixed_ips, 0, ip_address]} - ControlPlaneSubnetCidr: - if: - - ctlplane_subnet_cidr_set - - {get_param: ControlPlaneSubnetCidr} - - {str_split: ['/', {get_attr: [ControlVirtualIP, subnets, 0, cidr]}, 1]} + ControlPlaneSubnetCidr: {str_split: ['/', {get_attr: [Networks, net_attributes_map, ctlplane, subnets, {get_attr: [ServiceNetMap, vip_subnet_map, ctlplane]}, cidr]}, 1]} ControlPlaneNetwork: {get_param: NeutronControlPlaneID} PortName: redis_virtual_ip DnsName: null @@ -1089,11 +1082,7 @@ resources: type: OS::TripleO::Network::Ports::OVNDBsVipPort properties: ControlPlaneIP: {get_attr: [ControlVirtualIP, fixed_ips, 0, ip_address]} - ControlPlaneSubnetCidr: - if: - - ctlplane_subnet_cidr_set - - {get_param: ControlPlaneSubnetCidr} - - {str_split: ['/', {get_attr: [ControlVirtualIP, subnets, 0, cidr]}, 1]} + ControlPlaneSubnetCidr: {str_split: ['/', {get_attr: [Networks, net_attributes_map, ctlplane, subnets, {get_attr: [ServiceNetMap, vip_subnet_map, ctlplane]}, cidr]}, 1]} ControlPlaneNetwork: {get_param: NeutronControlPlaneID} PortName: ovn_dbs_virtual_ip DnsName: null @@ -1116,11 +1105,7 @@ resources: type: OS::TripleO::Network::Ports::{{network.name}}VipPort properties: ControlPlaneIP: {get_attr: [ControlVirtualIP, fixed_ips, 0, ip_address]} - ControlPlaneSubnetCidr: - if: - - ctlplane_subnet_cidr_set - - {get_param: ControlPlaneSubnetCidr} - - {str_split: ['/', {get_attr: [ControlVirtualIP, subnets, 0, cidr]}, 1]} + ControlPlaneSubnetCidr: {str_split: ['/', {get_attr: [Networks, net_attributes_map, ctlplane, subnets, {get_attr: [ServiceNetMap, vip_subnet_map, ctlplane]}, cidr]}, 1]} PortName: {{network.name_lower}}_virtual_ip {%- if network.name == 'External' %} DnsName: {str_split: ['.', {get_param: CloudName}, 0]} @@ -1147,11 +1132,7 @@ resources: type: OS::TripleO::Network::Ports::NetVipMap properties: ControlPlaneIp: {get_attr: [ControlVirtualIP, fixed_ips, 0, ip_address]} - ControlPlaneSubnetCidr: - if: - - ctlplane_subnet_cidr_set - - {get_param: ControlPlaneSubnetCidr} - - {str_split: ['/', {get_attr: [ControlVirtualIP, subnets, 0, cidr]}, 1]} + ControlPlaneSubnetCidr: {str_split: ['/', {get_attr: [Networks, net_attributes_map, ctlplane, subnets, {get_attr: [ServiceNetMap, vip_subnet_map, ctlplane]}, cidr]}, 1]} {%- for network in networks if network.vip|default(false) and network.enabled|default(true) %} {%- if network.name == 'External' %} ExternalIp: {get_attr: [PublicVirtualIP, ip_address]}