forked from indigo-dc/ansible-role-consul
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dnsmasq.yml
37 lines (31 loc) · 853 Bytes
/
dnsmasq.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
- name: install dnsmasq
package: name="dnsmasq" state=present
tags: dnsmasq
- name: Bind dnsmasq to localhost and docker bridge
lineinfile: dest=/etc/dnsmasq.conf state=present line="{{item}}"
with_items:
- "listen-address=127.0.0.1"
- "listen-address={{ docker_bridge_ip }}"
- name: configure consul resolution dnsmasq
template:
src: 10-consul.j2
dest: /etc/dnsmasq.d/10-consul
owner: root
group: root
mode: 0644
notify:
- restart dnsmasq
tags: dnsmasq
- name: make sure dnsmasq is running
service:
name: dnsmasq
state: started
enabled: yes
tags: dnsmasq
- name: update resolv.conf via dhclient conf
lineinfile: dest=/etc/dhcp/dhclient.conf state=present line="prepend domain-name-servers 127.0.0.1;"
notify:
- restart network service
tags: dnsmasq
- meta: flush_handlers