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
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1803203

Title:
  Support preferred_lft for IPv6 addresses

Status in netplan:
  New
Status in netplan.io package in Ubuntu:
  In Progress
Status in systemd package in Ubuntu:
  Fix Released

Bug description:
  There doesn't currently seem to be any way to set the preferred_lft of
  an IPv6 address.

  With the "ip" command it might be, for example:

  # ip address add 2001:db8::2/32 dev eth0 preferred_lft 0

  In a systemd unit file it might be:

  [Match]
  Name=eth0

  [Network]
  Address=2001:db8::2/32
  Gateway=2001:db8::1/32
  PreferredLifetime=0

  but I can't find any way to express this with netplan.

  This is commonly used for per-service IP addresses that should never
  be used as source addresses for outgoing traffic.

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

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to