add nameserver settings
This commit is contained in:
parent
aa7ca0d988
commit
3cf6d22034
@ -3,5 +3,6 @@ network_hostname: ''
|
||||
network_fqdn: ''
|
||||
network_defaultif: ''
|
||||
network_disable_ipv6: false
|
||||
network_dns_server: '8.8.8.8'
|
||||
|
||||
network_interfaces: {}
|
||||
|
@ -32,3 +32,11 @@
|
||||
when: item.key in ansible_interfaces
|
||||
notify:
|
||||
- network_restart
|
||||
|
||||
- name: set dns server
|
||||
template:
|
||||
src: 'etc/resolv.conf.j2'
|
||||
dest: '/etc/resolv.conf'
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
5
templates/etc/resolv.conf.j2
Normal file
5
templates/etc/resolv.conf.j2
Normal file
@ -0,0 +1,5 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
{% for item in network_dns_server %}
|
||||
nameserver {{ item }}
|
||||
{% endfor %}
|
Loading…
Reference in New Issue
Block a user