-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systemd_network resource does not allow multiple addresses #137
Comments
thanks for the report @schrd :) some variation of this comes up every once in a while and i'm still not super sure what a workable solution looks like... option_value is definitely designed to convert arrays into space-separated strings, because that's how systemd handles array-type arguments (e.g. Before=, After=, which take lists of units). for now, i think using the precursor property will let you inject an extra address field. in the past, the way we've worked around the limitation has been to use drop-in resources or the precursor property when needing to provide the same directive more than once. i'm open to any backwards-compatible suggestions! |
@schrd I also ran into this issue while trying to assign multiple vlans on one interface. After playing around a little with different solutions i went for the "ruby is anarchy" one and defined it like this:
IMHO this is ugly, but still better than defining a switchcase for each possible argument to differentiate between the different styles that are accepted by systemd configs. Maybe this should rather be fixed in systemd. |
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_value
is causing the issue.The systemd_unit resource correctly converts arrays to multiple entries:
produces
The text was updated successfully, but these errors were encountered: