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 }}" msg: "Interfaces list: {{ new_ints }}"
- name: network-interfaces | Install the network interface file - name: network-interfaces | Install the network interface file
ansible.builtin.template: ansible.builtin.template:
src: 70-ansible.yaml.j2 src: netplan-70-ansible.yaml.j2
dest: /etc/netplan/70-ansible.yaml dest: /etc/netplan/70-ansible.yaml
owner: root owner: root
group: root group: root

View File

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