Try to automate the interface names resolution.

This commit is contained in:
Andrea Dell'Amico 2023-12-04 12:15:01 +01:00
parent 9cc7139c2f
commit 23955f65c8
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@
msg: "Interfaces list: {{ new_ints }}"
- name: network-interfaces | Install the network interface file
ansible.builtin.template:
src: 70-ansible.yaml.j2
src: netplan-70-ansible.yaml.j2
dest: /etc/netplan/70-ansible.yaml
owner: root
group: root

View File

@ -1,7 +1,7 @@
network:
version: 2
ethernets:
{% for int in ubuntu_netplan_interfaces %}
{% for int in new_ints %}
{{ int.name }}:
dhcp4: {{ int.dhcp4 }}
{% if int.dhcp_overrides | default(true) %}