salt icon indicating copy to clipboard operation
salt copied to clipboard

[BUG] Ubuntu Focal (20.04) netplan config using network.managed

Open AmiramMaimon opened this issue 3 years ago • 4 comments

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

AmiramMaimon avatar Jun 26 '22 06:06 AmiramMaimon

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/*

OrangeDog avatar Jun 27 '22 07:06 OrangeDog

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.

AmiramMaimon avatar Jul 04 '22 07:07 AmiramMaimon

Yes, exactly what AmiramMaimon said. Too many rabbit holes before finally getting here.

jlkaiser avatar Aug 03 '22 18:08 jlkaiser

this error is still present and not mentioned in documentation

Grayfoox avatar Aug 10 '22 13:08 Grayfoox

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.

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).

gluf-technik avatar May 11 '23 11:05 gluf-technik