dns.yml 604 B

12345678910111213141516171819202122232425262728293031
  1. - name: 'Remove bind9 (not a suitable dnscache) packages'
  2. apt:
  3. pkg:
  4. - 'bind9'
  5. state: 'absent'
  6. purge: 'yes'
  7. when: with_dnscache|bool
  8. tags:
  9. - 'dns'
  10. - name: 'Install unbound (dnscache) packages'
  11. apt:
  12. pkg:
  13. - 'unbound'
  14. state: 'present'
  15. when: with_dnscache|bool
  16. tags:
  17. - 'dns'
  18. - name: 'Install resolv.conf'
  19. template:
  20. src: 'dns/resolv.conf.j2'
  21. dest: '/etc/resolv.conf'
  22. owner: 'root'
  23. group: 'root'
  24. mode: '0644'
  25. when: with_dnscache|bool or (nameservers is defined and nameservers|length > 0)
  26. tags:
  27. - 'dns'
  28. # vim: ft=yaml.ansible