multiple definitions of device ids between files are combined
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
New
|
Undecided
|
Unassigned |
Bug Description
There was a question as to what behavior we would see if multiple yaml files were included that reference the same device. The 05-snappy.yaml is a catch-all "DHCP on the first physical device called eth0" which generates a [Match]
I believe this is expected behavior but it does mean that if something like cloud-init generates networking configuration from user-data then it cannot keep existing netplan configurations around.
I'll leave this bug here which may be rejected as Invalid if this is expected behavior; It's likely not a bug since documentation indicates that the device identifiers must be unique
https:/
However, if this is the case, it would be reasonable to emit an error when they're not if the property in the documentation holds.
root@ubuntu:
nplan:
Installed: 0.18
Candidate: 0.18
Version table:
*** 0.18 500
500 http://
100 /var/lib/
root@ubuntu:
Description: Ubuntu Zesty Zapus (development branch)
Release: 17.04
root@ubuntu:
-rw-r--r-- 1 root root 63 Feb 15 18:48 /etc/netplan/
-rw-r--r-- 1 root root 822 Feb 15 18:50 /etc/netplan/
root@ubuntu:
network:
version: 2
ethernets:
eth0:
dhcp4: true
network:
ethernets:
eth0:
- 10.11.12.13/24
match:
eth1:
match:
eth2:
match:
bridges:
br0:
- 192.168.14.2/24
- eth1
- eth2
version: 2
root@ubuntu:
root@ubuntu:
root@ubuntu:
total 32
drwxr-xr-x 2 root root 200 Feb 15 18:51 .
drwxr-xr-x 19 root root 460 Feb 15 15:39 ..
-rw-r--r-- 1 root root 116 Feb 15 18:51 10-netplan-
-rw-r--r-- 1 root root 52 Feb 15 18:51 10-netplan-
-rw-r--r-- 1 root root 90 Feb 15 18:51 10-netplan-
-rw-r--r-- 1 root root 118 Feb 15 18:51 10-netplan-
-rw-r--r-- 1 root root 69 Feb 15 18:51 10-netplan-
-rw-r--r-- 1 root root 126 Feb 15 18:51 10-netplan-
-rw-r--r-- 1 root root 69 Feb 15 18:51 10-netplan-
-rw-r--r-- 1 root root 126 Feb 15 18:51 10-netplan-
root@ubuntu:
[Match]
MACAddress=
OriginalName=eth0
[Link]
Name=foobar0
WakeOnLan=off
[Match]
MACAddress=
Name=foobar0
[Network]
DHCP=ipv4
Address=
[DHCP]
RouteMetric=100
tags: | added: no-maas-impact |
This is expected behavior:
/* Files with asciibetically higher names override/append settings from
* earlier ones (in all config dirs); files in /run/netplan/
* shadow files in /etc/netplan/ which shadow files in /lib/netplan/.
You are meant to be able to generate cross-referencing configuration files or global configs which can then be invalidated by later files referencing the same devices and overriding the settings -- this allows shipping "global" configuration files with defaults, which are then customized to a user's liking via later files, possibly in a different directory.
My understanding is that it however means that you will not be able to reuse the name "eth0" as the name of a bond or another type of device if it has already been defined as an ethernet.