refactor(configuration): split network.yml into per-init-system dispatch files

This commit is contained in:
2026-02-20 21:16:45 +01:00
parent 462c2c7dfe
commit 72a9576abe
4 changed files with 93 additions and 93 deletions

View File

@@ -0,0 +1,26 @@
---
- name: Copy NetworkManager keyfile per interface
vars:
configuration_iface: "{{ item }}"
configuration_iface_name: >-
{{
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 }}"
ansible.builtin.template:
src: network.j2
dest: "/mnt/etc/NetworkManager/system-connections/LAN-{{ idx }}.nmconnection"
mode: "0600"
loop: "{{ system_cfg.network.interfaces }}"
loop_control:
index_var: idx
label: "LAN-{{ idx }}"
- name: Fix Ubuntu unmanaged devices
when: os in ["ubuntu", "ubuntu-lts"]
ansible.builtin.file:
path: /mnt/etc/NetworkManager/conf.d/10-globally-managed-devices.conf
state: touch
mode: "0644"