Skip to content
Snippets Groups Projects
Commit d313be44 authored by Matthew Mosesohn's avatar Matthew Mosesohn
Browse files

Improve management of nameservers in resolv.conf

Changing nameservers now will clean up previous entries
parent 83750d14
No related branches found
No related tags found
No related merge requests found
......@@ -86,14 +86,17 @@
follow: yes
- name: Add local dnsmasq to resolv.conf
lineinfile:
line: "nameserver {{item}}"
blockinfile:
dest: "{{resolvconffile}}"
block: |-
{% for item in nameserverentries -%}
nameserver {{ item }}
{% endfor %}
state: present
insertafter: "^search.*$"
create: yes
backup: yes
follow: yes
with_items: "{{nameserverentries}}"
marker: "# Ansible nameservers {mark}"
- name: Add options to resolv.conf
lineinfile:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment