--- # The role slurps the interfaces file before it compares, so the file must exist, and the # image has no /etc/network. Both files get a legacy body that differs from anything the # template renders, so the converge has a change to make and a backup to take. - name: Prepare hosts: all gather_facts: false tasks: - name: Create /etc/network ansible.builtin.file: path: /etc/network state: directory owner: root group: root mode: "0755" - name: Seed the interfaces files with a legacy body ansible.builtin.copy: dest: "{{ item }}" content: | # legacy seed auto lo iface lo inet loopback owner: root group: root mode: "0644" loop: - /etc/network/interfaces - /etc/network/interfaces.rollback