From a52064184e31773764188aaddfde2ca5873d1cf2 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Thu, 16 Mar 2017 17:58:17 +0300 Subject: [PATCH] Condense resolvconf sources before starting loop --- roles/kubernetes/preinstall/tasks/resolvconf.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/roles/kubernetes/preinstall/tasks/resolvconf.yml b/roles/kubernetes/preinstall/tasks/resolvconf.yml index 6369dfd9c1b..ef5a1f515a0 100644 --- a/roles/kubernetes/preinstall/tasks/resolvconf.yml +++ b/roles/kubernetes/preinstall/tasks/resolvconf.yml @@ -28,9 +28,8 @@ backup: yes follow: yes with_nested: - - "{{ [resolvconffile] + [base|default('')] + [head|default('')] }}" + - "{{ [resolvconffile, base|default(''), head|default('')] | difference(['']) }}" - [ 'search ', 'nameserver ', 'domain ', 'options ' ] - when: item[0] != "" notify: Preinstall | restart network - name: Remove search/domain/nameserver options after block @@ -41,9 +40,8 @@ backup: yes follow: yes with_nested: - - "{{ [resolvconffile] + [base|default('')] + [head|default('')] }}" + - "{{ [resolvconffile, base|default(''), head|default('')] | difference(['']) }}" - [ 'search ', 'nameserver ', 'domain ', 'options ' ] - when: item[0] != "" notify: Preinstall | restart network