mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-20 23:37:43 -02:30
feat: allows users to have more control on DNS (#9270)
Signed-off-by: eminaktas <eminaktas34@gmail.com> Signed-off-by: eminaktas <eminaktas34@gmail.com>
This commit is contained in:
@@ -9,12 +9,17 @@
|
||||
backup: yes
|
||||
notify: Preinstall | update resolvconf for networkmanager
|
||||
|
||||
- name: set default dns if remove_default_searchdomains is false
|
||||
set_fact:
|
||||
default_searchdomains: ["default.svc.{{ dns_domain }}", "svc.{{ dns_domain }}"]
|
||||
when: not remove_default_searchdomains|default()|bool or (remove_default_searchdomains|default()|bool and searchdomains|default([])|length==0)
|
||||
|
||||
- name: NetworkManager | Add DNS search to NM configuration
|
||||
ini_file:
|
||||
path: /etc/NetworkManager/conf.d/dns.conf
|
||||
section: global-dns
|
||||
option: searches
|
||||
value: "{{ ([ 'default.svc.' + dns_domain, 'svc.' + dns_domain ] + searchdomains|default([])) | join(',') }}"
|
||||
value: "{{ (default_searchdomains|default([]) + searchdomains|default([])) | join(',') }}"
|
||||
mode: '0600'
|
||||
backup: yes
|
||||
notify: Preinstall | update resolvconf for networkmanager
|
||||
@@ -24,7 +29,7 @@
|
||||
path: /etc/NetworkManager/conf.d/dns.conf
|
||||
section: global-dns
|
||||
option: options
|
||||
value: "ndots:{{ ndots }};timeout:2;attempts:2;"
|
||||
value: "ndots:{{ ndots }};timeout:{{ dns_timeout|default('2') }};attempts:{{ dns_attempts|default('2') }};"
|
||||
mode: '0600'
|
||||
backup: yes
|
||||
notify: Preinstall | update resolvconf for networkmanager
|
||||
|
||||
Reference in New Issue
Block a user