The cloudgw configuration for virt networks[0] is a bit of a mess, as the system was initially set up with a single v4-only network for Cloud VPS VMs and an another network for floating IPs. Over the years it has grown organically to support features like multiple networks and floating IP pools, IPv6, and most recently tenant networks with no internet connectivity (T394099)
The end result of that is a config that is spread across multiple manually maintained Hiera keys all using slightly different formats:
profile::wmcs::cloudgw::virt_subnets_cidr: # old legacy vlan-based subnet - 172.16.0.0/21 # vxlan dualstak subnet - 172.16.16.0/21 # vxlan ipv4 only subnet - 172.16.8.0/21 profile::wmcs::cloudgw::virt_subnets_cidr_v6: - 2a02:ec80:a000::/55 profile::wmcs::cloudgw::virt_internal_subnets_cidr: # octavia-lb-mgmt-net - 172.16.24.0/24 profile::wmcs::cloudgw::virt_floating: [185.15.56.0/25]
I propose transforming this to a single array with all of the different networks listed, perhaps something like this:
profile::wmcs::cloudgw::virt_subnets: # VLAN/legacy - networks: - 172.16.0.0/21 type: default # VXLAN/IPv4-only - networks: - 172.16.8.0/21 type: default # VXLAN/IPv6-dualstack - networks: - 172.16.16.0/21 - 2a02:ec80:a000:1::/64 type: default # octavia-lb-mgmt-net - networks: - 172.16.24.0/24 - 2a02:ec80:a000:100::/64 # no internet connectivity type: internal # cloud-eqiad1-floating - networks: - 185.15.56.0/25 type: floating
While this has some benefits on its own (namely, a format that's a bit more friendly to work with as it resembles more the format used for the same data in other places), the main benefit is that this is relatively easy to transform to a format with more than one place to route the networks to, which'll be needed for Toolforge-on-Metal. This is even more of a hypothetical example and not a definite final version, but just as an example the end goal could be something like this:
profile::wmcs::cloudgw::virt_interfaces: vlan1107: own_ip4: 185.15.56.234 # remaining configuration to bring the interface up moved here ... vlanNNNN: # configuration for the toolforge-on-metal interface here ... profile::wmcs::cloudgw::virt_targets: neutron: peer: interface: vlan1107 address4: 185.15.56.238 address6: 2a02:ec80:a000:fe04::2:1 networks: # VLAN/legacy - networks: - 172.16.0.0/21 type: default # VXLAN/IPv4-only - networks: - 172.16.8.0/21 type: default # VXLAN/IPv6-dualstack - networks: - 172.16.16.0/21 - 2a02:ec80:a000:1::/64 type: default # octavia-lb-mgmt-net - networks: - 172.16.24.0/24 - 2a02:ec80:a000:100::/64 # no internet connectivity type: internal # cloud-eqiad1-floating - networks: - 185.15.56.0/25 type: floating toolforge: peer: interface: vlanNNN # ... networks: # ... - networks: [192.0.2.0/24] type: default
[0]: currently: subnets used by Cloud VPS virtual networks (Neutron), soon also including Toolforge-on-Metal related networks