From 2586d01345434acbe98770cae7ba3a689e45a5c8 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 6369dfd9c..ef5a1f515 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