From 315acd9c9f22e8a926665f4c15273671bbb82699 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 5 Dec 2023 18:12:11 +0100 Subject: [PATCH] Fix the conditional in the template task. --- tasks/network-interfaces.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tasks/network-interfaces.yml b/tasks/network-interfaces.yml index 185668c..b7887d6 100644 --- a/tasks/network-interfaces.yml +++ b/tasks/network-interfaces.yml @@ -25,13 +25,17 @@ - name: network-interfaces | Print the name of the default interface ansible.builtin.debug: msg: "Loopback interface: {{ ansible_default_ipv4.interface }}" - - name: network-interfaces | Print the additional interfaces + - name: network-interfaces | List of interfaces other than the default one ansible.builtin.debug: msg: "Interfaces list: {{ new_ints }}" - name: network-interfaces | Override the interfaces list ansible.builtin.set_fact: new_ints: "{{ ubuntu_configure_additional_ints_list }}" when: ubuntu_configure_additional_ints_list | length != 0 + - name: network-interfaces | List of interfaces that we are going to configure + ansible.builtin.debug: + msg: "Interfaces list: {{ new_ints }}" + when: ubuntu_configure_additional_ints_list | length != 0 - name: network-interfaces | Install the network interface file ansible.builtin.template: src: netplan-70-ansible.yaml.j2 @@ -39,7 +43,7 @@ owner: root group: root mode: "0644" - when: ubuntu_netplan_interfaces is defined and ubuntu_netplan_interfaces | length != 0 + when: new_ints | length != 0 notify: Netplan Apply - name: network-interfaces | Force the Netplan Apply command execution