sync/roles/dns/tasks/main.yml
2018-04-12 12:59:03 -04:00

16 lines
391 B
YAML

- name: Change DNS
lineinfile:
path: /etc/dhcp/dhclient.conf
regexp: '^\s*prepend\s+domain-name-servers'
insertafter: 'prepend\s+domain-name-servers'
state: 'present'
line: 'prepend domain-name-servers 1.0.0.1;'
become: yes
register: changed_dns
- name: Restart networking
service:
name: network
state: restarted
become: yes
when: changed_dns.changed