mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-15 06:14:22 +03:00
Merge pull request #501 from kubespray/nameserver_update_fix
Improve management of nameservers in resolv.conf
This commit is contained in:
@@ -86,14 +86,17 @@
|
|||||||
follow: yes
|
follow: yes
|
||||||
|
|
||||||
- name: Add local dnsmasq to resolv.conf
|
- name: Add local dnsmasq to resolv.conf
|
||||||
lineinfile:
|
blockinfile:
|
||||||
line: "nameserver {{item}}"
|
|
||||||
dest: "{{resolvconffile}}"
|
dest: "{{resolvconffile}}"
|
||||||
|
block: |-
|
||||||
|
{% for item in nameserverentries -%}
|
||||||
|
nameserver {{ item }}
|
||||||
|
{% endfor %}
|
||||||
state: present
|
state: present
|
||||||
insertafter: "^search.*$"
|
create: yes
|
||||||
backup: yes
|
backup: yes
|
||||||
follow: yes
|
follow: yes
|
||||||
with_items: "{{nameserverentries}}"
|
marker: "# Ansible nameservers {mark}"
|
||||||
|
|
||||||
- name: Add options to resolv.conf
|
- name: Add options to resolv.conf
|
||||||
lineinfile:
|
lineinfile:
|
||||||
|
|||||||
Reference in New Issue
Block a user