main.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. - name: Void zones installed
  23. shell: void-zones-update.sh
  24. ignore_errors: true
  25. notify: Unbound restarted
  26. - name: Root hints installed
  27. shell: fetch ftp://ftp.internic.net/domain/named.cache -o /usr/local/etc/unbound/root.hints
  28. ignore_errors: true
  29. notify: Unbound restarted
  30. - name: Void zone cronjob configured
  31. cron:
  32. name: "Update void-zones-tools"
  33. special_time: monthly
  34. job: "/usr/local/bin/void-zones-update.sh && /usr/sbin/service unbound restart"
  35. ignore_errors: true
  36. - name: Root hints update cronjob configured
  37. cron:
  38. name: "Update root hints"
  39. special_time: monthly
  40. job: "fetch ftp://ftp.internic.net/domain/named.cache -o /usr/local/etc/unbound/root.hints"
  41. ignore_errors: true