-
Lukas Märdian authored
Implement YAML state tracking and use it in the DBus API and netplan-try (LP: #1943120) (FR-1745) (#231) Allow to pass an optional --state parameter to netplan try/apply describing a directory that contains a netplan configuration tree/state (i.e. /{etc,run,lib}/netplan/*.yaml). Netplan will make use of this "old state" to calculate the delta of dropped interface definitions, like bridges/bonds/vlans/tunnels that have been configured before but are not part of the current YAML configuration anymore. It will then try to delete those virtual interfaces (via ip link del dev IFACE) if they still exist. The same functionality is used to roll back a netplan try command that failed or was rejected. Generally, the state needs to be provided manually. The DBus API (using io.netplan.Netplan.Config.Try/Apply) is an exception, as the previous state can be backed up automatically in this case. COMMITS: * cli:apply:configmanager: clear_virtual_links during apply * tests:scenarios: check virtual interface cleanup * doc:apply: update manpage * cli:try: use clear_virtual_links from Apply() * dbus: make use of new YAML state tracking * dbus: properly create and clean the backup state dir * cli:apply:clear_virtual_links: make devices a named parameter