Score:1

Load Netplan yaml file from other directory apart from "/etc/netplan" in Ubuntu 22.04 LTS Desktop

bg flag

System - Ubuntu 22.04 LTS Desktop Netplan renderer - NetworkManager

Usecase -

  1. By default, there is a netplan yaml 01-network-manager-all.yaml file in /etc/netplan.
  2. On boot the netplan is applied.
  3. During runtime, there is a need to apply another netplan file 02-network-manager-all.yaml that is kept at /home/$USER/ProjectX/02-network-manager-all.yaml

Due to security factors, it is not possible to write directly to the file, since all the files after bootup will be in read-only mode, except the /home/$USER/ProjectX/02-network-manager-all.yaml file.

So during runtime, this file can be updated and when it is updated, need to apply the configuration.

Is it possible to load the 02-network-manager-all.yaml file from the specified location rather than copy to /etc/netplan and do a netplan apply? If possible, How to do it?

Looks like there were options like sudo netplan apply -c /path/to/file But, it does not work.

Score:0
vn flag

You could make a symlink - this would probably be the preferred way of doing this:

ln -s /home/$USER/ProjectX/02-network-manager-all.yaml /etc/netplan/02-network-manager-all.yaml

Then netplan would see this file normally in /etc/netplan, even though the actual file is located in /home/$USER/ProjectX.

shaggy avatar
bg flag
The symlink option works, but is there any other way to update the default path of netplan files ? As I understood, the netplan will look for the files in {run, etc, lib}/netplan But can this configuration be changed so that permanently it will load from any location specified ?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.