Thanks a lot for your explanations and workaround examples.
I expanded our ansible update playbooks to check if /etc/netplan/10-lxc.yaml is installed, then to remove that file, runs "netplan apply" and then remove the package "netplan.io". It seems to work in our environment, without loosing the network configuration while updating and also after reboot.
Here is the ansible section we tested. Maybe it is helpful to anyone else. This script comes with no warranty and should be tested in your environment thoroughly.
Thanks a lot for your explanations and workaround examples.
I expanded our ansible update playbooks to check if /etc/netplan/ 10-lxc. yaml is installed, then to remove that file, runs "netplan apply" and then remove the package "netplan.io". It seems to work in our environment, without loosing the network configuration while updating and also after reboot.
Here is the ansible section we tested. Maybe it is helpful to anyone else. This script comes with no warranty and should be tested in your environment thoroughly.
- name: Is Netplan configuring LXC? 10-lxc. yaml 10-lxc. yaml stat.exists == true and ansible_ virtualization_ type == 'lxc'" stat.exists == true and ansible_ virtualization_ type == 'lxc'" stat.exists == true and ansible_ virtualization_ type == 'lxc'"
stat:
path: /etc/netplan/
register: netplan
- name: Remove networkd/netplan configuration
file:
path: /etc/netplan/
state: absent
when: "netplan.
- name: Reload networkd/netplan
command: netplan apply
when: "netplan.
- name: Remove netplan.io
apt:
name: netplan.io
state: absent
when: "netplan.