diff --git a/roles/proxmox/tasks/main.yml b/roles/proxmox/tasks/main.yml index add0130..6f88e05 100644 --- a/roles/proxmox/tasks/main.yml +++ b/roles/proxmox/tasks/main.yml @@ -13,6 +13,13 @@ apt_repository: repo: 'deb http://download.proxmox.com/debian/pve {{ ansible_distribution_release }} pve-no-subscription' +- name: Set up loopback interface + template: + dest: /etc/network/interfaces.d/loopback.intf + src: loopback.intf.j2 + mode: 0644 + notify: reload interfaces + - include_tasks: mgmt.yml - include_tasks: sdn.yml diff --git a/roles/proxmox/templates/10-network.rules.j2 b/roles/proxmox/templates/10-network.rules.j2 deleted file mode 100644 index 1a45f77..0000000 --- a/roles/proxmox/templates/10-network.rules.j2 +++ /dev/null @@ -1,5 +0,0 @@ -{% for name in hwaddr %} -{% for addr in hwaddr[name] %} -SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="{{ addr }}", NAME="{{ name }}{{ loop.index0 }}" -{% endfor %} -{% endfor %} diff --git a/roles/proxmox/templates/interfaces.j2 b/roles/proxmox/templates/interfaces.j2 deleted file mode 100644 index 086e974..0000000 --- a/roles/proxmox/templates/interfaces.j2 +++ /dev/null @@ -1,16 +0,0 @@ -auto lo -iface lo inet loopback - -auto mgmt -iface mgmt - address 127.0.0.1/8 - address ::1/128 - vrf-table auto - -auto {{ iface_mgmt }} -iface {{ iface_mgmt }} - vrf mgmt - address {{ ansible_host }}/{{ mgmt_gw | ipaddr('prefix') }} - gateway {{ mgmt_gw | ipaddr('address') }} - -source /etc/network/interfaces.d/* diff --git a/roles/debian/templates/interfaces.j2 b/templates/interfaces.j2 similarity index 94% rename from roles/debian/templates/interfaces.j2 rename to templates/interfaces.j2 index 3631206..d86e240 100644 --- a/roles/debian/templates/interfaces.j2 +++ b/templates/interfaces.j2 @@ -1,5 +1,3 @@ -source /etc/network/interfaces.d/* - # Management VRF and link. auto mgmt iface mgmt @@ -20,3 +18,5 @@ iface {{ iface.name }} {% endfor %} {% endfor %} + +source /etc/network/interfaces.d/* \ No newline at end of file diff --git a/roles/debian/templates/loopback.intf.j2 b/templates/loopback.intf.j2 similarity index 100% rename from roles/debian/templates/loopback.intf.j2 rename to templates/loopback.intf.j2