---
- name: Configure named master
  hosts: router
  roles:
    - named
  vars:
# Primary Configuration
    named_listen_ipv4:
      - "any"
    named_listen_ipv4_port:
      - 53
    named_listen_ipv6:
      - "::"
    named_listen_ipv6_port:
      - 53
    named_recursion: true
    named_allow_recursion:
      - "Local"
    named_allow_query:
      - "any"
    named_allow_transfer:
      - "Transfer"
    named_dns_keys:
      - name: CertbotKey
        algorithm: hmac-sha256
        secret: "YCUScDPbF9bscPFB0mLzRr2/V54FB7tcrifAdrrnlBI="
    named_extra_include_files:
      - "{{ named_auth_file }}"
    named_statistics_channels:
      - named_statistics_host: '127.0.0.1'
      - named_statistics_port: '8053'
      - named_statistics_allow:
          - '127.0.0.1'

    named_acls:
      - name: Transfer
        match_list:
          - 80.211.195.127
          - 212.60.5.16
      - name: Local
        match_list:
          - 127.0.0.0/8
          - 10.0.0.0/8
          - 172.16.0.0/12
          - 192.168.0.0/16

    named_zones:
      - name: 'local.mrwho.ru'
        type: primary
#        certbot_key: "CerbotKey"
#        also_notify:
#          - 172.20.21.100
        primaries:
          - 172.20.21.100
          - 212.60.5.162
        name_servers:
          - ns.local.mrwho.ru.
        hosts:
          - name: 'local.mrwho.ru.'
            ip: 172.20.21.1
          - name: ca
            ip: 172.20.21.99
          - name: ns
            ip: 172.20.21.100
          - name: router
            ip: 172.20.21.100
          - name: opensearch
            ip: 172.20.21.101
          - name: uyuni
            ip: 172.20.21.102
          - name: vault
            ip: 172.20.21.103
          - name: gitlab
            ip: 172.20.21.104
