Add nodelocaldns only if it is enabled (#7731)

pull/8270/head
Alvaro Campesino 2021-12-04 05:36:31 +01:00 committed by GitHub
parent dfdebda0b6
commit 30d9882851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -147,7 +147,7 @@
- name: generate nameservers to resolvconf
set_fact:
nameserverentries:
nameserver {{ ( coredns_server|d([]) + nameservers|d([]) + cloud_resolver|d([])) | unique | join(',nameserver ') }}
nameserver {{ ( ( [nodelocaldns_ip] if enable_nodelocaldns else []) + coredns_server|d([]) + nameservers|d([]) + cloud_resolver|d([])) | unique | join(',nameserver ') }}
supersede_nameserver:
supersede domain-name-servers {{ ( coredns_server|d([]) + nameservers|d([]) + cloud_resolver|d([])) | unique | join(', ') }};

View File

@ -1,5 +1,5 @@
[Resolve]
DNS={{ coredns_server | list | join(' ') }}
DNS={{ (nodelocaldns_ip |default(coredns_server) )| list | join(' ') }}
FallbackDNS={{ ( nameservers|d([]) + cloud_resolver|d([])) | unique | join(' ') }}
Domains={{ ([ 'default.svc.' + dns_domain, 'svc.' + dns_domain ] + searchdomains|default([])) | join(' ') }}
#LLMNR=no