Handle dns_mode set to 'none' in generate nameservers task (#6825)

When dns_mode was set to 'none' the coredns_server became an empty
string and invalid operation of adding string to list was executed.
pull/6871/head
Michal Skalski 2020-10-29 09:04:58 +01:00 committed by GitHub
parent 102fb94524
commit c93fa6effe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -131,6 +131,8 @@
{{ [ skydns_server ] + [ skydns_server_secondary ] }}
{%- elif dns_mode == 'manual' and not dns_early|bool -%}
{{ ( manual_dns_server.split(',') | list) }}
{%- elif dns_mode == 'none' and not dns_early|bool -%}
[]
{%- elif dns_early|bool -%}
{{ upstream_dns_servers|default([]) }}
{%- endif -%}
@ -138,9 +140,9 @@
- name: generate nameservers to resolvconf
set_fact:
nameserverentries:
nameserver {{ ( coredns_server + nameservers|d([]) + cloud_resolver|d([])) | unique | join(',nameserver ') }}
nameserver {{ ( coredns_server|d([]) + nameservers|d([]) + cloud_resolver|d([])) | unique | join(',nameserver ') }}
supersede_nameserver:
supersede domain-name-servers {{ ( coredns_server + nameservers|d([]) + cloud_resolver|d([])) | unique | join(', ') }};
supersede domain-name-servers {{ ( coredns_server|d([]) + nameservers|d([]) + cloud_resolver|d([])) | unique | join(', ') }};
- name: gather os specific variables
include_vars: "{{ item }}"