[BUG] Ubuntu Focal (20.04) netplan config using network.managed
Hey,
When using the network.managed state on Ubuntu Focal (20.04) version in order to configure/update an interface its edit the interfaces file instead of the netplan files.
It causes an unexpected behavior when restarting (applying) the netplan service like:
- Removing the salt configuration
- Failed to reload the netplan service
network.managed example, any example would behave the same --> editing the "wrong" file.
I would expect that it would edit the /etc/netplan/*.yaml files and not the /etc/network/interface file
Versions
Master version: 3004
Minion version: 3004.1 running on Ubuntu 20.04.2 LTS
Best regards, Amiram
Related: #54791 and #57541
I suggest using file.serialized instead of the very outdated network.managed, along with a cmd.run:
netplan apply:
cmd.run:
- onchanges:
- file: /etc/netplan/*
If that true and you are not going to update the network.managed status deprecate it or at least add a warning that it outdated.
Yes, exactly what AmiramMaimon said. Too many rabbit holes before finally getting here.
this error is still present and not mentioned in documentation
If that true and you are not going to update the
network.managedstatus deprecate it or at least add a warning that it outdated.
The function should still work on non-netplan/networkd minions on G@os_family:Debian and (BusyBox based?) distributions like Alpine which use /etc/network/interfaces, too (see "Configuring Networking" on wiki.alpinelinux), after you've changed if os_family == "Debian" to if os_family in ["Debian", "Alpine"].
"Should" as I still have to test a bit also how to decide when to switch to a netplan based configuration so I don't have to bother with networkd (directly).