mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-23 08:37:54 -02:30
kubernetes/preinstall: dns setting cleanup(dhclient, resolvconf)
We use a lot of facts where variables are enough, and format too early, which prevent reusing the variables in different contexts. - Moves set_fact variables to the vars directory, remove unnecessary intermediate variables, and render them at usage sites to only do logic on native Ansible/Jinja lists. - Use defaults/ rather than default filters for several variables.
This commit is contained in:
@@ -7,10 +7,9 @@
|
||||
blockinfile:
|
||||
path: "{{ resolvconffile }}"
|
||||
block: |-
|
||||
{% for item in [domainentry] + [searchentries] -%}
|
||||
{{ item }}
|
||||
{% endfor %}
|
||||
{% for item in nameserverentries.split(',') %}
|
||||
domain {{ dns_domain }}
|
||||
search {{ (default_searchdomains + searchdomains) | join(' ') }}
|
||||
{% for item in nameserverentries %}
|
||||
nameserver {{ item }}
|
||||
{% endfor %}
|
||||
options ndots:{{ ndots }} timeout:{{ dns_timeout | default('2') }} attempts:{{ dns_attempts | default('2') }}
|
||||
|
||||
Reference in New Issue
Block a user