Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Commit

Permalink
Merge pull request #6 from gibbsoft/feature_dns_options
Browse files Browse the repository at this point in the history
Added support for DNS resolver options.
  • Loading branch information
jdauphant authored Nov 13, 2017
2 parents a295ae7 + aab7e75 commit 3bea4ce
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Ansible role for configure DNS
# Examples :
```
- hosts: all
roles:
roles:
- role: ansible-role-dns
dns_domain: localdomain
dns_nameservers: ['127.0.0.1', '8.8.8.8']
Expand All @@ -15,6 +15,7 @@ Ansible role for configure DNS
roles:
- role: ansible-role-dns
dns_nameservers: ['8.8.8.8']
dns_searchs: ['localdomain', 'otherdomain']
dns_searchs: "localdomain otherdomain"
dns_options: ['timeout:3', 'attempts:5']
```
5 changes: 3 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
dns_nameservers: ['8.8.8.8', '8.8.4.4']
dns_remove_resolvconf: true
dns_domain: "localdomain"
dns_searchs:
- "{{dns_domain}}"
dns_searchs:
- "{{dns_domain}}"
dns_options: []
dns_dhclient_rule: "supersede" # can be supersede or prepend

dns_dhclient_file: "/etc/dhcp/dhclient.conf"
Expand Down
4 changes: 4 additions & 0 deletions templates/resolv.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ nameserver {{nameserver}}
{% if dns_searchs is defined %}
search {% for name in dns_searchs %}{{name}} {% endfor %}
{% endif %}

{% for options in dns_options %}
options {{options}}
{% endfor %}

0 comments on commit 3bea4ce

Please sign in to comment.