From a518f49c7b3da8d31aa99ec8828bb3faa597680d Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Thu, 19 Sep 2019 19:49:02 +0000 Subject: [PATCH] base: rework the conditional for nmcli controlled ifcfg files to be more readable. Signed-off-by: Kevin Fenzi --- roles/base/tasks/main.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index 86085b5947..28f2991030 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -102,7 +102,15 @@ # - restart NetworkManager - reload NetworkManager-connections - apply interface-changes - when: (virthost is not defined) and (item.startswith(('eth','br','enc','em'))) and (hostvars[inventory_hostname]['ansible_' + item.replace('-','_')]['type'] == 'ether') and (ansible_distribution_major_version|int >=7) and hostvars[inventory_hostname]['ansible_' + item.replace('-','_')]['active'] and nmclitest is success and ( not ansible_ifcfg_blacklist ) and ( ansible_ifcfg_whitelist is not defined or item in ansible_ifcfg_whitelist ) + when: + - virthost is not defined + - item.startswith(('eth','br','enc','em')) + - hostvars[inventory_hostname]['ansible_' + item.replace('-','_')]['type'] == 'ether' + - hostvars[inventory_hostname]['ansible_' + item.replace('-','_')]['active'] + - ansible_distribution_major_version|int >=7 + - nmclitest is success + - not ansible_ifcfg_blacklist + - ansible_ifcfg_whitelist is not defined or item in ansible_ifcfg_whitelist tags: - config - ifcfg