Skip to content
Snippets Groups Projects
Commit a005d19f authored by Matthew Mosesohn's avatar Matthew Mosesohn Committed by Kubernetes Prow Robot
Browse files

Enable systemd-resolved DNS resolution mode (#5318)

Change-Id: If3e253a40782e03cde7fc4a91493517ae31fda17
parent 471589f1
No related branches found
No related tags found
No related merge requests found
...@@ -95,3 +95,8 @@ ...@@ -95,3 +95,8 @@
- inventory_hostname in groups['kube-master'] - inventory_hostname in groups['kube-master']
- dns_mode != 'none' - dns_mode != 'none'
- resolvconf_mode == 'host_resolvconf' - resolvconf_mode == 'host_resolvconf'
- name: Preinstall | Restart systemd-resolved
service:
name: systemd-resolved
state: restarted
...@@ -43,6 +43,13 @@ ...@@ -43,6 +43,13 @@
changed_when: false changed_when: false
check_mode: no check_mode: no
- name: check systemd-resolved
command: systemctl is-active systemd-resolved
register: systemd_resolved_enabled
failed_when: false
changed_when: false
check_mode: no
- name: set dns facts - name: set dns facts
set_fact: set_fact:
resolvconf: >- resolvconf: >-
......
---
- name: Write resolved.conf
template:
src: resolved.conf.j2
dest: /etc/systemd/resolved.conf
owner: root
group: root
mode: 0644
notify: Preinstall | Restart systemd-resolved
...@@ -32,6 +32,16 @@ ...@@ -32,6 +32,16 @@
when: when:
- dns_mode != 'none' - dns_mode != 'none'
- resolvconf_mode == 'host_resolvconf' - resolvconf_mode == 'host_resolvconf'
- systemd_resolved_enabled.rc != 0
tags:
- bootstrap-os
- resolvconf
- import_tasks: 0061-systemd-resolved.yml
when:
- dns_mode != 'none'
- resolvconf_mode == 'host_resolvconf'
- systemd_resolved_enabled.rc == 0
tags: tags:
- bootstrap-os - bootstrap-os
- resolvconf - resolvconf
......
[Resolve]
{% if dns_late %}
DNS={{ ( coredns_server + nameservers|d([]) + cloud_resolver|d([])) | unique | join(' ') }}
{% else %}
DNS={{ ( nameservers|d([]) + cloud_resolver|d([])) | unique | join(' ') }}
{% endif %}
#FallbackDNS=
Domains={{ ([ 'default.svc.' + dns_domain, 'svc.' + dns_domain ] + searchdomains|default([])) | join(' ') }}
#LLMNR=no
#MulticastDNS=no
DNSSEC=no
Cache=no-negative
#DNSStubListener=yes
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment