main.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. ---
  2. - name: Unbound installed
  3. community.general.pkgng:
  4. name: "unbound void-zones-tools"
  5. state: latest
  6. ignore_errors: true
  7. - name: Unbound enabled
  8. shell: sysrc unbound_enable="YES"
  9. - name: Unbound config file installed
  10. copy:
  11. src: unbound.conf
  12. dest: /usr/local/etc/unbound/unbound.conf
  13. owner: root
  14. mode: 0644
  15. ignore_errors: true
  16. notify: Unbound restarted
  17. - name: Unbound service zones file installed
  18. copy:
  19. src: service.zones
  20. dest: /var/unbound/service.zones
  21. mode: 0644
  22. notify: Unbound restarted
  23. tags: zone-update
  24. - name: Unbound unblink zones file installed
  25. copy:
  26. src: unblink.zones
  27. dest: /var/unbound/unblink.zones
  28. mode: 0644
  29. notify: Unbound restarted
  30. tags: zone-update
  31. - name: Void zones installed
  32. shell: void-zones-update.sh
  33. ignore_errors: true
  34. notify: Unbound restarted
  35. - name: Root hints installed
  36. shell: fetch ftp://ftp.internic.net/domain/named.cache -o /usr/local/etc/unbound/root.hints
  37. ignore_errors: true
  38. notify: Unbound restarted
  39. - name: Void zone cronjob configured
  40. cron:
  41. name: "Update void-zones-tools"
  42. special_time: monthly
  43. job: "/usr/local/bin/void-zones-update.sh && /usr/sbin/service unbound restart"
  44. ignore_errors: true
  45. - name: Root hints update cronjob configured
  46. cron:
  47. name: "Update root hints"
  48. special_time: monthly
  49. job: "fetch ftp://ftp.internic.net/domain/named.cache -o /usr/local/etc/unbound/root.hints"
  50. ignore_errors: true