Public bug reported:
Running a v2 network-config through cloud-init's net-convert we can see
that we're not passing it through, but importing and re-rendering lossy.
% cat simple-v2.yaml
network:
version: 2
# comment above ethernets
ethernets:
ens0:
dhcp4: true
match:
macaddress: 00:11:22:33:44:55
set-name: ens0
switchports:
# all cards on second PCI bus; unconfigured by themselves, will be added
# to br0 below
match:
name: enp2*
mtu: 1280
% PYTHONPATH=`pwd` ./tools/net-convert.py --network-data simple-v2.yaml
--kind yaml --output-kind netplan -d target
% cat target/etc/netplan/50-cloud-init.yaml
network:
version: 2
ethernets:
ens0:
dhcp4: true
switchports:
mtu: 1280
We lose comments and matching.
Also note, ./tools/net-convert.py has a bug, the order of parameters to
the rendering class changed.
% git diff tools/net-convert.py
diff --git a/tools/net-convert.py b/tools/net-convert.py
index 870da63..ec4ee64 100755
--- a/tools/net-convert.py
+++ b/tools/net-convert.py
@@ -75,7 +75,7 @@ def main():
r_cls = sysconfig.Renderer
r = r_cls()
- r.render_network_state(ns, target=args.directory)
+ r.render_network_state(args.directory, ns)
if __name__ == '__main__':
** Affects: cloud-init (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1685927
Title:
cloud-init network v2 config loses some settings when rendered
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1685927/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs