From f74d41a8f0706da6b9251164186ac4c2e3be243d Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Thu, 7 Mar 2024 09:53:25 +0100 Subject: [PATCH] split DNS/DHCP check and message --- roles/satellite-clone/tasks/interface_check.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/roles/satellite-clone/tasks/interface_check.yml b/roles/satellite-clone/tasks/interface_check.yml index fcc77c1..485d81f 100644 --- a/roles/satellite-clone/tasks/interface_check.yml +++ b/roles/satellite-clone/tasks/interface_check.yml @@ -1,11 +1,18 @@ --- -- name: Fail if interfaces on machine do not match backup metadata interfaces +- name: Fail if interfaces on machine do not match backup metadata DNS interfaces fail: - msg: "The network interface {{ proxy_config.dns_interface }} setup for DNS and {{ proxy_config.dhcp_interface }} setup for DHCP do not match the network interfaces on the current machine" + msg: "The network interface {{ proxy_config.dns_interface }} setup for DNS do not match the network interfaces on the current machine" when: - proxy_config.dns - - proxy_config.dhcp - proxy_config.dns_interface not in network_interfaces + vars: + network_interfaces: "{{ ansible_interfaces | reject('match', 'lo') | list }}" + +- name: Fail if interfaces on machine do not match backup metadata DHCP interfaces + fail: + msg: "The network interface {{ proxy_config.dhcp_interface }} setup for DHCP do not match the network interfaces on the current machine" + when: + - proxy_config.dhcp - proxy_config.dhcp_interface not in network_interfaces vars: network_interfaces: "{{ ansible_interfaces | reject('match', 'lo') | list }}"