Use dns
This commit is contained in:
parent
02aa2898a5
commit
1369ee6d15
1
main.yml
1
main.yml
@ -8,3 +8,4 @@
|
|||||||
- {role: youcompleteme, tags: [vim,youcompleteme]}
|
- {role: youcompleteme, tags: [vim,youcompleteme]}
|
||||||
- {role: secure, become: yes, tags: [secure]}
|
- {role: secure, become: yes, tags: [secure]}
|
||||||
- {role: test, tags: [test]}
|
- {role: test, tags: [test]}
|
||||||
|
- {role: dns, tags: [dns]}
|
||||||
|
15
roles/dns/tasks/main.yml
Normal file
15
roles/dns/tasks/main.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
- 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
|
@ -34,3 +34,4 @@
|
|||||||
state: 'present'
|
state: 'present'
|
||||||
line: 'PermitRootLogin without-password'
|
line: 'PermitRootLogin without-password'
|
||||||
notify: restart_sshd
|
notify: restart_sshd
|
||||||
|
- meta: flush_handlers
|
||||||
|
Loading…
Reference in New Issue
Block a user