Bionic netplan render invalid yaml duplicate anchor declaration for nameserver entries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
High
|
Unassigned | ||
cloud-init (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Cosmic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The netplan configuration redeclares the nameservers anchor for every single section (vlans, bonds), and use the same id for similar entries (id001).
In this specific case the network configuration in maas have a bond0 with two vlans, bond0.3502 and bond0.3503, and an untagged bond1 without vlans. The rendered 50-cloud-init.yaml looks like this:
network:
version: 2
ethernets:
...
bonds:
...
bond1:
...
- 255.255.255.1
- 255.255.255.2
- 255.255.255.3
- 255.255.255.5
- customer.domain
- maas
...
bondM:
...
vlans:
bond0.3502:
...
- 255.255.255.1
- 255.255.255.2
- 255.255.255.3
- 255.255.255.5
- customer.domain
- maas
bond0.3503:
...
As the cloudinit renders an invalid yaml file, the netplan apply produces the following error: (due to the anchor redeclaration in the vlans section):
Invalid YAML at /etc/netplan/
This render bug prevents us using the untagged bond and the bond with the vlans in the same configuration.
Related branches
- Server Team CI bot: Approve (continuous-integration)
- Chad Smith: Approve
-
Diff: 421 lines (+355/-8)4 files modifiedcloudinit/net/netplan.py (+2/-1)
cloudinit/safeyaml.py (+7/-0)
cloudinit/util.py (+10/-7)
tests/unittests/test_net.py (+336/-0)
Changed in cloud-init: | |
status: | Confirmed → In Progress |
Changed in cloud-init (Ubuntu): | |
importance: | Undecided → High |
status: | New → In Progress |
Can you please run 'sudo cloud-init collect-logs' and attach the log file and the contents of /etc/netplan/