diff --git a/roles/debian/tasks/main.yml b/roles/debian/tasks/main.yml index a24382b..11d7942 100644 --- a/roles/debian/tasks/main.yml +++ b/roles/debian/tasks/main.yml @@ -42,19 +42,22 @@ - vim - tmux -# we don’t want to template this file because it gets overwritten by proxmox -# so just try removing anything that messes with our definitions in interfaces.d +# for base Debian the main interfaces file is just an include - name: Remove interface definitions added by installer - lineinfile: - path: /etc/network/interfaces - regexp: '^iface [^ ]* inet' - state: absent + when: not is_proxmox + copy: + dest: /etc/network/interfaces + content: 'source /etc/network/interfaces.d/*' notify: reload interfaces +# for Proxmox the main interfaces file will define bridges +# here we just remove the vmbr0 definition created by installer to preserve idempotency - name: Include interfaces.d definitions + when: is_proxmox lineinfile: path: /etc/network/interfaces - line: 'source /etc/network/interfaces.d/*' + regexp: '^(auto vmbr0|iface vmbr0|\t)' # our definitions start with four spaces instead of tab + state: absent notify: reload interfaces - name: Set up interfaces @@ -121,5 +124,3 @@ name: sshd@mgmt enabled: yes notify: reboot - - - meta: flush_handlers