Add nodelocaldns only if it is enabled (#7731)

This commit is contained in:
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