dns.yml 628 B

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