-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
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/24If 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']
endproduces an invalid file which systemd-networkd rejects:
[Match]
Name = en* eth*
[Network]
DHCP = no
Address = 192.168.121.4/24 192.168.121.2/24To 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
endproduces
[Unit]
Description = Foo
Description = barReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels