Skip to content

Commit

Permalink
Merge pull request #7 from Oefenweb/pr-6
Browse files Browse the repository at this point in the history
Remove /etc/resolv.conf before configure dns servers
  • Loading branch information
tersmitten committed Jun 26, 2017
2 parents 97e4b58 + 3a0cb44 commit 9504546
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,30 @@
- dns
- dns-remove-resolvconf

- name: get resolvconf file stats
stat:
path: "{{ dns_resolvconf_file }}"
register: _resolvconf_file_stats
when: dns_remove_resolvconf
tags:
- configuration
- dns
- dns-resolvconf-file-stats

- name: remove resolvconf symlink
file:
path: "{{ dns_resolvconf_file }}"
state: absent
when: dns_remove_resolvconf and _resolvconf_file_stats is defined and _resolvconf_file_stats.stat is defined and _resolvconf_file_stats.stat.islnk
tags:
- configuration
- dns
- dns-remove-resolvconf

- name: configure dns servers - /etc/resolv.conf
template:
src: etc/resolv.conf.j2
dest: /etc/resolv.conf
dest: "{{ dns_resolvconf_file }}"
tags:
- configuration
- dns
Expand Down
1 change: 1 addition & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# vars file for dns
---
dns_resolvconf_file: /etc/resolv.conf

0 comments on commit 9504546

Please sign in to comment.