configure_caching.yml 927 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. - name: install cache only nameserver
  2. hosts: caching_dns
  3. remote_user: devops
  4. become: yes
  5. vars:
  6. interface: 0.0.0.0
  7. interface_automatic: "yes"
  8. access_control:
  9. - "172.25.250.0/24 allow"
  10. domain_insecure: example.com
  11. forward_zone_name: .
  12. forward_zone_addr: "172.25.250.254"
  13. tasks:
  14. - name: install cache only nameserver
  15. yum:
  16. name: unbound
  17. state: present
  18. - name: create conf file in server
  19. template:
  20. src: unbound.conf.j2
  21. dest: /etc/unbound/conf.d/unbound.conf
  22. - name: allow dns on firewall
  23. firewalld:
  24. service: dns
  25. state: enabled
  26. permanent: yes
  27. immediate: yes
  28. - name: ensure unbound is running and enabled
  29. service:
  30. name: unbound
  31. state: started
  32. enabled: yes
  33. handlers:
  34. - name: restart_unbound
  35. service:
  36. name: unbound
  37. state: restarted