proxmox: fix network interface renaming
Use systemd .link files which are "relatively futureproof" according to https://wiki.debian.org/NetworkInterfaceNames .
This commit is contained in:
parent
59c1431f93
commit
ea1f8f88d0
2 changed files with 11 additions and 3 deletions
|
@ -1,8 +1,11 @@
|
||||||
- name: Add rules to rename network interfaces
|
- name: Add rules to rename network interfaces
|
||||||
template:
|
template:
|
||||||
dest: /etc/udev/rules.d/10-network.rules
|
dest: "/etc/systemd/network/10-{{ item.name }}.link"
|
||||||
src: 10-network.rules.j2
|
src: interface.link.j2
|
||||||
mode: 0644
|
mode: "0644"
|
||||||
|
loop: "{{ interfaces | selectattr('mac_address') }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.name }}"
|
||||||
notify: reboot
|
notify: reboot
|
||||||
|
|
||||||
- name: Set up bridges
|
- name: Set up bridges
|
||||||
|
|
5
templates/interface.link.j2
Normal file
5
templates/interface.link.j2
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[Match]
|
||||||
|
MACAddress={{ item.mac_address | lower }}
|
||||||
|
|
||||||
|
[Link]
|
||||||
|
Name={{ item.name }}
|
Loading…
Add table
Add a link
Reference in a new issue