You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
889 B

  1. ---
  2. - name: Import OS variables
  3. include_vars: "{{ ansible_os_family }}.yml"
  4. - name: install unbound
  5. package:
  6. name: unbound
  7. state: latest
  8. notify:
  9. - enable_unbound
  10. - restart_unbound
  11. - name: upload conf for local DNS
  12. copy:
  13. src: localdns.conf
  14. dest: "{{ unbound_conf_path }}/localdns.conf"
  15. notify:
  16. - restart_unbound
  17. - name: upload forward zone template
  18. template:
  19. src: forwardzone.conf.j2
  20. dest: "{{ unbound_conf_path }}/forwardzone.conf"
  21. notify:
  22. - restart_unbound
  23. - name: download root file from NIC
  24. get_url:
  25. url: ftp://FTP.INTERNIC.NET/domain/named.cache
  26. dest: /etc/unbound/root-hints.cache
  27. notify:
  28. - restart_unbound
  29. - name: Add cron to refresh root zone
  30. cron:
  31. name: "refresh DNS root zone"
  32. special_time: monthly
  33. job: "curl -o /etc/unbound/root-hints.cache ftp://FTP.INTERNIC.NET/domain/named.cache"