netplan fails to apply /run/netplan/*.yaml config at startup
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
New
|
Undecided
|
Unassigned |
Bug Description
In my system with Ubuntu 18.04 server OS, I have a CDROM with an iso file which contains a single netplan *.yaml config that gets mounted to /run/netplan/ at startup.
However, after bootup, the *.yaml config is not applied to the network interface. I need to manually execute "sudo netplan apply" for the netplan config in /run/netplan/ to be applied to the network interface.
I have created a run-netplan.mount unit to ensured systemd mounts the CDROM to /run/netplan/ before the network starts at bootup; however, the expected netplan config is still not applied after bootup.
Any help or feedback will be much appreciated. Thanks.
-------
content of /run/netplan/
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
addresses:
- 10.10.10.2/24
gateway4: 10.10.10.1
nameservers:
search: [mydomain, otherdomain]
-------
content of /etc/systemd/
[Unit]
Description=Mount CD-ROM as netplan config
Before=
[Mount]
What=/dev/sr0
Where=/run/netplan
[Install]
WantedBy=
-------
content of /etc/fstab:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=85e259f0-
/swapfile none swap sw 0 0
/dev/sr0 /run/netplan udf,iso9660 user,auto,
Hmm, interesting.
On boot netplan runs as a systemd generator.
Looking at https:/ /www.freedeskto p.org/software/ systemd/ man/systemd. generator. html, it looks like it will have run well before your unit file kicks in.
Could you try setting up your unit file to run 'netplan generate' after mounting?
Regards,
Daniel