- block:
  - name: Uninstall network-manager
    apt:
      name: network-manager
      state: absent
      purge: yes

  - name: Remove persistent net rules and generator
    file:
      path: "{{ item }}"
      state: absent
    with_items:
      - /lib/udev/rules.d/75-persistent-net-generator.rules
      - /etc/udev/rules.d/70-persistent-net.rules

  - name: Install udev rules for ethernet
    copy:
      src: "73-zoox-ethernet.rules"
      dest: "/etc/udev/rules.d/73-zoox-ethernet.rules"
      owner: root
      group: root
      mode: '644'

  - name: Setup network interfaces
    template:
      src: "interfaces.j2"
      dest: "/etc/network/interfaces"
      owner: root
      group: root
      mode: '644'

  become: yes
