main.yml 1.4 KB

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