main.yml 1012 B

123456789101112131415161718192021222324252627282930
  1. ---
  2. - name: "Generate ACL list for DNS server"
  3. set_fact:
  4. acl_list: "{{ acl_list | default([]) + [ (hostvars[item]['private_v4'] + '/32') ] }}"
  5. with_items: "{{ groups['cluster_hosts'] }}"
  6. - name: "Generate the private view"
  7. set_fact:
  8. private_named_view:
  9. - name: "private"
  10. recursion: "{{ named_private_recursion }}"
  11. acl_entry: "{{ acl_list }}"
  12. zone:
  13. - dns_domain: "{{ full_dns_domain }}"
  14. forwarder: "{{ public_dns_nameservers }}"
  15. when: external_nsupdate_keys['private'] is undefined
  16. - name: "Generate the public view"
  17. set_fact:
  18. public_named_view:
  19. - name: "public"
  20. recursion: "{{ named_public_recursion }}"
  21. zone:
  22. - dns_domain: "{{ full_dns_domain }}"
  23. forwarder: "{{ public_dns_nameservers }}"
  24. when: external_nsupdate_keys['public'] is undefined
  25. - name: "Generate the final named_config_views"
  26. set_fact:
  27. named_config_views: "{{ private_named_view|default([]) + public_named_view|default([]) }}"