--- - name: Remove cloudinit sudoers file file: path: "/etc/sudoers.d/90-cloud-init-users" state: absent - name: Remove cloudinit netplan file: path: "/etc/netplan/50-cloud-init.yaml" state: absent when: ansible_facts["lsb"]["id"] == "Ubuntu" - name: Remove cloudinit network configuration file: path: "/etc/network/interfaces.d/50-cloud-init" state: absent when: ansible_facts["lsb"]["id"] == "Debian" - name: Disable cloudinit file: path: "/etc/cloud/cloud-init.disabled" owner: root group: root mode: "0644" state: touch modification_time: preserve access_time: preserve