From 5e5f5fae27891f5ad12c5714b9b5c12e438bfc53 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 24 Apr 2020 19:21:38 -0700 Subject: [PATCH] Don't do 'nmcli con up' on disabled interfaces This should avoid us turning on interfaces the config is telling us shouldn't be turned on. Should only affect openQA-related boxes, as those are the only ones that use ansible_ifcfg_disabled at present. It is defined as an empty list in group_vars/all, so we shouldn't need to worry about it not being defined. Also converts from the deprecated with_items syntax to loop syntax. Signed-off-by: Adam Williamson --- handlers/restart_services.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handlers/restart_services.yml b/handlers/restart_services.yml index 5c731207e8..33c4efa5bb 100644 --- a/handlers/restart_services.yml +++ b/handlers/restart_services.yml @@ -170,8 +170,8 @@ command: nmcli con up {{ item.split()[1] }} async: 1 poll: 0 - with_items: - - "{{ if_uuid.stdout_lines }}" + loop: "{{ if_uuid.stdout_lines|flatten(levels=1) }}" + when: item.split()[1] not in ansible_ifcfg_disabled - name: flush journald tmpfiles to persistent store command: pkill -f -USR1 systemd-journald