main.yml 624 B

123456789101112131415161718192021
  1. ---
  2. # tasks file for ff-dns
  3. - name: Ensure unbound is installed
  4. apt: name=unbound state=present update_cache=yes cache_valid_time=3600
  5. - name: Ensure unbound config already exists
  6. file: dest=/etc/unbound/unbound.conf.d state=directory recurse=yes
  7. - name: Install unbound configs
  8. template: src={{item.src}} dest={{item.dest}}
  9. with_items:
  10. - src: unbound.conf.j2
  11. dest: /etc/unbound/unbound.conf
  12. - src: unbound-supernode.conf.j2
  13. dest: /etc/unbound/unbound.conf.d/supernode.conf
  14. notify:
  15. - Restart unbound
  16. - name: Ensure unbound is started and enabled
  17. service: name=unbound state=started enabled=yes