diff --git a/overcloud.j2.yaml b/overcloud.j2.yaml index 9ab62b4f48..6b8f2c8add 100644 --- a/overcloud.j2.yaml +++ b/overcloud.j2.yaml @@ -627,6 +627,7 @@ resources: - all_nodes # provided by tripleo-hieradata - vip_data # provided by tripleo-hieradata - net_ip_map + - ovn_chassis_mac_map # provided by tripleo_hieradata - '%{::osfamily}' # The following are required for compatibility with the Controller role # where some vendor integrations added hieradata via ExtraConfigPre diff --git a/puppet/role.role.j2.yaml b/puppet/role.role.j2.yaml index c4fedf18b2..54d9c63f4e 100644 --- a/puppet/role.role.j2.yaml +++ b/puppet/role.role.j2.yaml @@ -635,17 +635,29 @@ resources: type: json value: yaql: - expression: let(physnets => switch(isList($.data.physnets) => $.data.physnets, true => [])) -> - $physnets.zip($.data.macs).toDict($.first(), $.last()) + # In cases where OS::TripleO::OVNMacAddressPort is set to OS::Heat::None (ie. standalone), + # the macs will be null resulting in a mapping like { "datacentre" : null}. This isn't + # particularly valid or useful and will cause the ovn_controller to crash. This + # outer yaql expression filters out any of these sorts of mappings. There are probably + # alternative approaches that would also work like deleting entries from the 'macs' + # but I'm wary of breaking up the implied matched ordering between the bridge mappings + # and the ports in the event that nulls and real values might coexist in some weird + # case. + expression: let(macmap=>switch(isDict($.data.macmap) => $.data.macmap, true => {})) -> $macmap.deleteAll($macmap.keys().where($macmap[$] = null)) data: - physnets: + macmap: yaql: - expression: $.data.select($.split(':').first()) - data: {get_param: OVNBridgeMappings} - macs: - yaql: - expression: switch(isDict($.data) => $.data.values(), true => []) - data: {get_attr: [{{server_resource_name}}OVNChassisMacPorts, attributes, mac_address]} + expression: let(physnets => switch(isList($.data.physnets) => $.data.physnets, true => [])) -> + $physnets.zip($.data.macs).toDict($.first(), $.last()) + data: + physnets: + yaql: + expression: $.data.select($.split(':').first()) + data: {get_param: OVNBridgeMappings} + macs: + yaql: + expression: switch(isDict($.data) => $.data.values(), true => []) + data: {get_attr: [{{server_resource_name}}OVNChassisMacPorts, attributes, mac_address]} outputs: ansible_host_vars_map: