- name:
|
|
lineinfile:
|
|
dest: '/etc/hosts'
|
|
line: '{{ ansible_default_ipv4.address }} {{ ansible_hostname }}'
|
|
regexp: '^\s*\S* {{ ansible_hostname }}'
|
|
delegate_to: gandalf2
|
|
register: hosts
|
|
|
|
- name: restart dnsmasq
|
|
shell: "/etc/init.d/dnsmasq restart"
|
|
delegate_to: gandalf2
|
|
when: hosts.changed
|