fix systemd templates

This commit is contained in:
2023-08-13 14:03:03 +10:00
parent a2ec933cf8
commit e1fb6b94ee
8 changed files with 62 additions and 30 deletions

View File

@ -14,7 +14,7 @@
- name: Create systemd-networkd config files
ansible.builtin.template:
src: "{{ item.src }}"
dest: /etc/systemd/network/"{{ item.name }}"
dest: /etc/systemd/network/{{ item.name }}
owner: root
group: root
mode: '0644'

View File

@ -3,6 +3,5 @@ PermanentMACAddress={{ item.mac_address }}
[Link]
Name={{ item.name | regex_replace('^[0-9]*-', '') | regex_replace('\.link', '') }}
MACAddressPolicy=permanent
MACAddress={{ item.mac_address }}
MACAddressPolicy=persistent

View File

@ -1,5 +1,5 @@
[Match]
MACAddress={{ item.mac_address }}
Name={{ item.name | regex_replace('^[0-9]*-', '') | regex_replace('\.network', '') }}
[Link]
ARP={{ item.arp | default(true) }}
@ -62,7 +62,7 @@ Type=unicast
{% endif -%}
{% if item.bridge is defined and item.bridge.vlans is defined %}
[BridgeVLANs]
[BridgeVLAN]
{% for vlan in item.bridge.vlans -%}
VLAN={{ vlan }}
{% endfor -%}