[Question/Undestanding]: Ubuntu provisioning with multiple Interfaces/NIC fails - template error

Hello Foreman Community,
I failed to get the provisioning of Ubuntu with multiple NICs to work so far.

Problem:
When a host is submitted with configured 3 Nics foreman fails with:

2021-06-24T09:04:20 [E|app|38c8af42] There was an error rendering the
Preseed default finish template: ERF42-7327 [Foreman::Exception]: 
The snippet 'preseed_networking_setup' threw an error: 
Safemode doesn't allow to access 'addresses' on #<Safemode::ScopeObject>

When I turn off safemode I get:

2021-06-24T09:21:20 [I|app|2f11a309] Backtrace for 'Review template error' error 
(Foreman::Exception): ERF42-7327 [Foreman::Exception]: 
The snippet 'preseed_networking_setup' threw an error:
 undefined local variable or method `addresses' for
 #<Foreman::Renderer::Scope::Provisioning:0x000055f1e99224b8>

The Template preseed_networking_setup used here and the corresponding line: foreman/preseed_networking_setup.erb at develop · theforeman/foreman · GitHub

I noticed that addresses was not used in the previous version of the template. Where should it be set? It is missing in the Template?

As soon as I removed the managed flag on the 2 additional interfaces not used for provisioning, the provisioning was successfull.

Next I will try to just use only one address per Interface… if i get that working I will add it here.

Expected outcome:

Ubuntu Host will be provisioned with Multiple Nics and configured in netplan

Foreman and Proxy versions:
Foreman 2.4.0
Foreman Smart Proxy 2.4.0

Foreman and Proxy plugin versions:

Distribution and version:
on Ubuntu 18.04

Other relevant data:

Hello,

I have modified the snippet to just add one IP to each additional nic not used for provisioning.

This does not set any nameservers or search domains for these additional nics yet.

It seems that this was a bug, which should be fixed now: Bug #32981: Latest preseed_networking_setup template snippet does not work Ubuntu 18.04+ with multiple nics - Foreman