---
- name: Configure named secondary
  hosts: vm01
  roles:
    - named

  vars:
# secondary 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: CerbotKey
        algorithm: hmac-sha512
        secret: as1NQi1QHYX/hAuSR+EbyPYZNgsM2NcTTmSDvPFzkghzUNHAFFSQmabs03gm543vH6X4gYFKXhkzRP2/gQ7nNA==
    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
      - 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:
      # secondary server for domain gigacoms.info (specify zone type explicitly)
      - name: 'mrwho.ru'
        type: secondary
        primaries:
          - 212.60.5.162

      - name: 'nimfalida.ru'
        type: secondary
        primaries:
          - 212.60.5.162

      - name: 'storagecat.ru'
        type: secondary
        primaries:
          - 212.60.5.162

      - name: 'astracpa.com'
        type: secondary
        primaries:
          - 212.60.5.162
