2 - name: install unbound
3 apt: name=unbound state=latest
5 - name: configure unbound
7 dest: /etc/unbound/unbound.conf.d/listen.conf
8 src: files/unbound/listen.conf
9 register: unbound_config
10 - name: restart unbound
11 # not a handler to make sure it succeeds before we go touch system DNS
12 when: unbound_config.changed
13 service: name=unbound state=restarted enabled=yes
14 - name: configure system DNS
16 dest: /etc/resolv.conf
17 content: "nameserver 127.0.0.2\n"