dns.yml 465 B

123456789101112131415
  1. - name: Remove bind9 (not a suitable dnscache) packages
  2. apt: pkg={{ item }} state=absent purge=yes
  3. with_items:
  4. - bind9
  5. when: with_dnscache
  6. - name: Install unbound (dnscache) packages
  7. apt: pkg={{ item }} state=installed update_cache=yes
  8. with_items:
  9. - unbound
  10. when: with_dnscache
  11. - name: Install resolv.conf
  12. template: src=dns/resolv.conf.j2 dest=/etc/resolv.conf owner=root group=root mode=0644
  13. when: with_dnscache or nameservers is defined