Track origin file for each individual YAML setting/stanza
Bug #2003727 reported by
Lukas Märdian
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Triaged
|
High
|
Unassigned |
Bug Description
In order to properly update the YAML hierarchy or (over-)write new settings, e.g. via "netplan set", Netplan needs to know the origin file of each individual setting.
Storing the "filepath" on a per NetDef level is not enough, as a higher level file could modify/extend an existing NetDef, such that its final definition would be generated from two different YAML files.
The "private_
tags: | added: fr-3277 |
Changed in netplan: | |
status: | New → Triaged |
importance: | Undecided → Wishlist |
Changed in netplan: | |
importance: | Wishlist → High |
To post a comment you must log in.
"netplan set" is not working properly when you have openvswitch configuration. After running netplan set the resulting configuration will contain many duplicated lines. This was tested after https:/ /github. com/canonical/ netplan/ pull/299 be merged.
How to reproduce the issue
apt install -y openvswitch-switch
wget https:/ /raw.githubuser content. com/canonical/ netplan/ main/examples/ openvswitch. yaml -O /etc/netplan/ openvswitch. yaml
netplan set network. bonds.bond0. interfaces= null bonds.bond0. interfaces= [patch1- 0] ethernets. eth1=null
netplan set network.
netplan set network.
and check the files generated/changed.
In a simpler case where you have the openvswitch.yaml from netplan/examples and the file below, the result when using --origin-hint contains openvswitch configuration.
# cat 50-cloud-init.yaml
network:
version: 2
ethernets:
enp5s0:
dhcp4: false
root@deleteme- lunar:/ etc/netplan# netplan set --origin-hint 90-snapd-config network. ethernets. enp5s0. dhcp4=true
# cat 90-snapd- config. yaml
network:
version: 2
ethernets:
enp5s0:
dhcp4: true
openvswitch:
ports:
- - patch0-1
- patch1-0
external-ids:
somekey: "somevalue"
...
When not using --origin-hint, the files 50-cloud-init.yaml and 70-netplan-set.yaml will both contain openvswitch configuration.