From 29c2fbdbc1872fb0e101804bd9f94e86bf9fe193 Mon Sep 17 00:00:00 2001 From: Pavel Martynov Date: Tue, 18 May 2021 16:41:30 +0300 Subject: [PATCH] Fix cloud_resolver type from str to list (issue #7605) (#7606) --- roles/kubernetes/preinstall/tasks/0040-set_facts.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/roles/kubernetes/preinstall/tasks/0040-set_facts.yml b/roles/kubernetes/preinstall/tasks/0040-set_facts.yml index 75d7bd184..0f687062c 100644 --- a/roles/kubernetes/preinstall/tasks/0040-set_facts.yml +++ b/roles/kubernetes/preinstall/tasks/0040-set_facts.yml @@ -50,14 +50,9 @@ {% for d in [ 'default.svc.' + dns_domain, 'svc.' + dns_domain ] + searchdomains|default([]) -%} {{ dns_domain }}.{{ d }}./{{ d }}.{{ d }}./com.{{ d }}./ {%- endfor %} - cloud_resolver: >- - {%- if cloud_provider is defined and cloud_provider == 'gce' -%} - ['169.254.169.254'] - {%- elif cloud_provider is defined and cloud_provider == 'aws' -%} - ['169.254.169.253'] - {%- else -%} - [] - {%- endif -%} + cloud_resolver: "{{ ['169.254.169.254'] if cloud_provider is defined and cloud_provider == 'gce' else + ['169.254.169.253'] if cloud_provider is defined and cloud_provider == 'aws' else + [] }}" - name: check if kubelet is configured stat: