From 514b465954287b1923ca0bd2bf621e360eb22731 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 4 Dec 2023 11:52:37 +0100 Subject: [PATCH] Print the loopback and default interface names. --- tasks/network-interfaces.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tasks/network-interfaces.yml b/tasks/network-interfaces.yml index de5eef3..ea00bed 100644 --- a/tasks/network-interfaces.yml +++ b/tasks/network-interfaces.yml @@ -19,6 +19,12 @@ ansible.builtin.set_fact: new_ints: "[{% for i in ansible_interfaces %}{% if i != ansible_lo.device or i != ansible_default_ipv4.interface %}{{ i }}{% if not loop.last %},{% endif %}{% endif %}{% endfor %}]" when: net_ints is defined and net_ints | length != 0 + - name: network-interfaces | Print the loopback interface name + ansible.builtin.debug: + msg: "Loopback interface: {{ ansible_lo.device }}" + - 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 ansible.builtin.debug: msg: "Interfaces list: {{ new_ints }}" @@ -37,4 +43,3 @@ tags: - network_interface - networking -