add nameserver settings

This commit is contained in:
Robert Kaussow 2017-07-14 13:24:33 +02:00
parent aa7ca0d988
commit 3cf6d22034
3 changed files with 14 additions and 0 deletions

View File

@ -3,5 +3,6 @@ network_hostname: ''
network_fqdn: '' network_fqdn: ''
network_defaultif: '' network_defaultif: ''
network_disable_ipv6: false network_disable_ipv6: false
network_dns_server: '8.8.8.8'
network_interfaces: {} network_interfaces: {}

View File

@ -32,3 +32,11 @@
when: item.key in ansible_interfaces when: item.key in ansible_interfaces
notify: notify:
- network_restart - network_restart
- name: set dns server
template:
src: 'etc/resolv.conf.j2'
dest: '/etc/resolv.conf'
owner: root
group: root
mode: 0644

View File

@ -0,0 +1,5 @@
# {{ ansible_managed }}
{% for item in network_dns_server %}
nameserver {{ item }}
{% endfor %}