Currently, addresses is a "sequence of scalars" (aka a list). Here is
the example from the Netplan reference you quoted:

addresses: [192.168.14.2/24, "2001:1::1/64"]

This can, currently, also be written in this form (quotes optional):
addresses:
 - 192.168.14.2/24
 - "2001:1::1/64"

I actually prefer the latter form, so that's what I use today.

In YAML generally (not necessarily Netplan specifically), I think the
obvious extension would be to support dictionaries in addition to
scalars, for the addresses. That would allow for this type of extension:

addresses:
 - 192.168.14.2/24
 - "2001:1::1/64":
     lifetime: 0
     other: x
     future: y
     parameters: z

If you really want the flattened form, it would be:
addresses: [192.168.14.2/24, "2001:1::1/64": {lifetime: 0}]

This is a clean extension from the current syntax and supports other
future parameters.

Whether Netplan's YAML parser currently supports dictionaries is another
question. But this is all normal YAML. See, for example, Ansible:
https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1803203

Title:
  Support preferred_lft for IPv6 addresses

To manage notifications about this bug go to:
https://bugs.launchpad.net/netplan/+bug/1803203/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to