summaryrefslogtreecommitdiffstats
path: root/roles/dns-views/tasks/main.yml
blob: 7165b4269c1d755c675f7a31dd8067e5d3ff38dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---
- name: "Generate ACL list for DNS server"
  set_fact:
    acl_list: "{{ acl_list | default([]) + [ (hostvars[item]['private_v4'] + '/32') ] }}"
  with_items: "{{ groups['cluster_hosts'] }}"

- name: "Generate the private view"
  set_fact:
    private_named_view:
      - name: "private"
        acl_entry: "{{ acl_list }}"
        zone:
          - dns_domain: "{{ full_dns_domain }}"

- name: "Generate the public view"
  set_fact:
    public_named_view:
      - name: "public"
        zone:
          - dns_domain: "{{ full_dns_domain }}"
        forwarder: "{{ public_dns_nameservers }}"

- name: "Generate the final named_config_views"
  set_fact:
    named_config_views: "{{ private_named_view + public_named_view }}"