main.yml 1.1 KB

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