From 23955f65c8d05fb819c6a86c3ee4d9f78083eae1 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 4 Dec 2023 12:15:01 +0100 Subject: [PATCH] Try to automate the interface names resolution. --- tasks/network-interfaces.yml | 2 +- templates/{70-ansible.yaml.j2 => netplan-70-ansible.yaml.j2} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename templates/{70-ansible.yaml.j2 => netplan-70-ansible.yaml.j2} (86%) diff --git a/tasks/network-interfaces.yml b/tasks/network-interfaces.yml index adc2bef..f7a98d5 100644 --- a/tasks/network-interfaces.yml +++ b/tasks/network-interfaces.yml @@ -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 diff --git a/templates/70-ansible.yaml.j2 b/templates/netplan-70-ansible.yaml.j2 similarity index 86% rename from templates/70-ansible.yaml.j2 rename to templates/netplan-70-ansible.yaml.j2 index b4154f9..0b8f0fb 100644 --- a/templates/70-ansible.yaml.j2 +++ b/templates/netplan-70-ansible.yaml.j2 @@ -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) %}