configure_caching.yml.solution 959 B

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