/srv/irclogs.ubuntu.com/2022/08/30/#netplan.txt

keenfolks - trying to use `netplan set` to set a default route for an interface. I can't make heads or tails out of how I'd translate the -to: and via: lines of the yaml into the format that set wants.   I don't see any examples in the `test_cli_get_set.py` that cover routes or similar structures (or ANY `set` examples in the "examples"...).   can someone point me to a clue?00:10
schopinkeen: reading the parsing code, I *think* something along those lines should work: `netplan set 'ethernets.eth0.routes=[{"to":"1.2.3.4/24", "via":"56.78.90.12"}]'`. Basically, add your routes as a JSON array.08:35
schopinkeen: however, there's a caveat: if you already have routes configured, the code will ignore your new routes if the JSON array size has the same number of elements than the one in the current definition.08:36
schopinI'm guessing that's a bug :)08:36
keenappreciated!  apparently the lack of single quotes was killing me.  that's exactly where I landed as "this must work" but apparently ignored the fact that the quotes inside the flat json would be ignored.13:32
keenand...fun bug.13:32
keen. o O ( well, consumed, and not make it to the parser )13:33
keen`netplan set 'ethernets.eth1.routes=[{"to":"default", "via":"10.200.1.1"}]'13:33
keen`13:33
keenworks!13:33
schopinGreat to hear :)13:45
keenbridge.interfaces, otoh...it seems to validate the interfaces existance inside bridges, not inside ethernets. 13:52
keenat least for this one I can just create the yaml raw (I dont need to update it)13:52
keenbridges.<bridge>.interfaces anyway.  and there seem to be a few random conditions that dont work there13:53
schopinkeen: that seems odd. Do you have a reproducer for your bridge interface existence issue?14:01
keenyeah I'll put a pastebin together when I get a chance (probably after my next call)14:30
keenschopin: https://gist.github.com/keen99/fd740872c84a8ba35b7f1c7c716e80f716:28

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!