A network unit file can specify multiple static addresses for an interface. Even mixing of IPv4 and IPv6 addresses is possible. A working example would look like
[Match]
Name = en* eth*
[Network]
DHCP = no
Address = 192.168.121.4/24
Address = 192.168.121.2/24
If I specify a systemd_network resource such as
systemd_network 'static' do
match_name 'en* eth*'
network_address ['192.168.121.4/24', '192.168.121.2/24']
end
produces an invalid file which systemd-networkd rejects:
[Match]
Name = en* eth*
[Network]
DHCP = no
Address = 192.168.121.4/24 192.168.121.2/24
To me it looks like SystemdCookbook::Mixin::PropertyHashConversion::InstanceMethods#option_value is causing the issue.
The systemd_unit resource correctly converts arrays to multiple entries:
u = systemd_unit 'test.service' do
content({
Unit: {
Description: ['Foo', 'bar']
}
})
end
file "/tmp/test.ini" do
content u.to_ini
end
produces
[Unit]
Description = Foo
Description = bar
A network unit file can specify multiple static addresses for an interface. Even mixing of IPv4 and IPv6 addresses is possible. A working example would look like
If I specify a systemd_network resource such as
produces an invalid file which systemd-networkd rejects:
To me it looks like
SystemdCookbook::Mixin::PropertyHashConversion::InstanceMethods#option_valueis causing the issue.The systemd_unit resource correctly converts arrays to multiple entries:
produces