Skip to content

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

Closed

Description

@AmiramMaimon

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

Activity

  1. added
    bug
    on Jun 26, 2022
  2. OrangeDog commented on Jun 27, 2022

    @OrangeDog
    Contributor

    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/*
  3. added
    ubuntu
    on Jun 27, 2022
  4. AmiramMaimon commented on Jul 4, 2022

    @AmiramMaimon
    Author

    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.

  5. jlkaiser commented on Aug 3, 2022

    @jlkaiser

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

  6. Grayfoox commented on Aug 10, 2022

    @Grayfoox

    this error is still present and not mentioned in documentation

  7. gluf-technik commented on May 11, 2023

    @gluf-technik
    Contributor

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

  8. ggiesen commented on Jul 1, 2026

    @ggiesen
    Contributor

    I've submitted a PR for an implementation if anyone interested would like to test.

  9. added a commit that references this issue on Jul 10, 2026
    729b76b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triageubuntu

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions