fix(configuration): omit interface-name when not explicitly provided to avoid predictable naming mismatch
This commit is contained in:
@@ -2,12 +2,7 @@
|
|||||||
- name: Copy NetworkManager keyfile per interface
|
- name: Copy NetworkManager keyfile per interface
|
||||||
vars:
|
vars:
|
||||||
configuration_iface: "{{ item }}"
|
configuration_iface: "{{ item }}"
|
||||||
configuration_iface_name: >-
|
configuration_iface_name: "{{ item.name | default('') }}"
|
||||||
{{
|
|
||||||
item.name
|
|
||||||
if (item.name | default('') | string | length) > 0
|
|
||||||
else (configuration_detected_interfaces[idx] | default('eth' ~ idx))
|
|
||||||
}}
|
|
||||||
configuration_net_uuid: "{{ ('LAN-' ~ idx ~ '-' ~ hostname) | ansible.builtin.to_uuid }}"
|
configuration_net_uuid: "{{ ('LAN-' ~ idx ~ '-' ~ hostname) | ansible.builtin.to_uuid }}"
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: network.j2
|
src: network.j2
|
||||||
|
|||||||
@@ -2,7 +2,10 @@
|
|||||||
id=LAN-{{ idx }}
|
id=LAN-{{ idx }}
|
||||||
uuid={{ configuration_net_uuid }}
|
uuid={{ configuration_net_uuid }}
|
||||||
type=ethernet
|
type=ethernet
|
||||||
|
autoconnect-priority=10
|
||||||
|
{% if configuration_iface_name | length > 0 %}
|
||||||
interface-name={{ configuration_iface_name }}
|
interface-name={{ configuration_iface_name }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
[ipv4]
|
[ipv4]
|
||||||
{% set iface = configuration_iface %}
|
{% set iface = configuration_iface %}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
if (system_raw.network.interfaces | default([]) | length > 0)
|
if (system_raw.network.interfaces | default([]) | length > 0)
|
||||||
else (
|
else (
|
||||||
[{
|
[{
|
||||||
'name': 'eth0',
|
'name': '',
|
||||||
'bridge': system_raw.network.bridge | default('') | string,
|
'bridge': system_raw.network.bridge | default('') | string,
|
||||||
'vlan': system_raw.network.vlan | default('') | string,
|
'vlan': system_raw.network.vlan | default('') | string,
|
||||||
'ip': system_raw.network.ip | default('') | string,
|
'ip': system_raw.network.ip | default('') | string,
|
||||||
|
|||||||
Reference in New Issue
Block a user