Skip to content
Snippets Groups Projects
Commit 73a8c240 authored by Smaine Kahlouch's avatar Smaine Kahlouch Committed by GitHub
Browse files

Merge pull request #501 from kubespray/nameserver_update_fix

Improve management of nameservers in resolv.conf
parents 83750d14 d313be44
No related branches found
No related tags found
No related merge requests found
...@@ -86,14 +86,17 @@ ...@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment