2020-06-29 07:26:17 +00:00
|
|
|
---
|
|
|
|
- name: NetworkManager | Add nameservers to NM configuration
|
|
|
|
ini_file:
|
2020-09-07 09:27:41 +00:00
|
|
|
path: /etc/NetworkManager/conf.d/dns.conf
|
|
|
|
section: global-dns-domain-*
|
|
|
|
option: servers
|
2022-02-26 18:29:23 +00:00
|
|
|
value: "{{ nameserverentries }}"
|
2020-06-29 07:26:17 +00:00
|
|
|
mode: '0600'
|
|
|
|
backup: yes
|
2022-02-26 18:29:23 +00:00
|
|
|
notify: Preinstall | update resolvconf for networkmanager
|
2020-06-29 07:26:17 +00:00
|
|
|
|
2022-09-23 17:28:26 +00:00
|
|
|
- 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)
|
|
|
|
|
2020-06-29 07:26:17 +00:00
|
|
|
- name: NetworkManager | Add DNS search to NM configuration
|
|
|
|
ini_file:
|
2020-09-07 09:27:41 +00:00
|
|
|
path: /etc/NetworkManager/conf.d/dns.conf
|
|
|
|
section: global-dns
|
|
|
|
option: searches
|
2022-09-23 17:28:26 +00:00
|
|
|
value: "{{ (default_searchdomains|default([]) + searchdomains|default([])) | join(',') }}"
|
2020-06-29 07:26:17 +00:00
|
|
|
mode: '0600'
|
|
|
|
backup: yes
|
2022-02-26 18:29:23 +00:00
|
|
|
notify: Preinstall | update resolvconf for networkmanager
|
2020-06-29 07:26:17 +00:00
|
|
|
|
|
|
|
- name: NetworkManager | Add DNS options to NM configuration
|
|
|
|
ini_file:
|
2020-09-07 09:27:41 +00:00
|
|
|
path: /etc/NetworkManager/conf.d/dns.conf
|
|
|
|
section: global-dns
|
|
|
|
option: options
|
2022-09-23 17:28:26 +00:00
|
|
|
value: "ndots:{{ ndots }};timeout:{{ dns_timeout|default('2') }};attempts:{{ dns_attempts|default('2') }};"
|
2020-06-29 07:26:17 +00:00
|
|
|
mode: '0600'
|
|
|
|
backup: yes
|
2022-02-26 18:29:23 +00:00
|
|
|
notify: Preinstall | update resolvconf for networkmanager
|