---
- name: default
  description: Default pool
<% if @attributes.empty? -%>
  attributes: {}
<% else -%>
  attributes:
<% @attributes.sort.each do |key, val| -%>
    <%= key %>: <%= val %>
<% end -%>
<% end -%>

  ns_records:
<% @ns_records.sort.each do |priority, hostname| -%>
    - hostname: <%= hostname %>
      priority: <%= priority.to_s %>
<% end -%>

  nameservers:
<% @nameservers.each do |nameserver| -%>
    - host: <%= nameserver %>
      port: <%= @dns_port.to_s %>
<% end -%>

  targets:
<% @bind9_hosts.each do |bind9_host| -%>
    - type: bind9
      description: BIND9 Server <%= bind9_host %>

      masters:
<% @mdns_hosts.each do |mdns_host| -%>
        - host: <%= mdns_host %>
          port: <%= @mdns_port.to_s %>
<% end -%>

      options:
        host: <%= bind9_host %>
        port: <%= @dns_port.to_s %>
        rndc_host: <%= bind9_host %>
<% if !@rndc_port.nil? -%>
        rndc_port: <%= @rndc_port %>
<% end -%>
<% if !@rndc_config_file.nil? -%>
        rndc_config_file: <%= @rndc_config_file %>
<% end -%>
<% if !@rndc_key_file.nil? -%>
        rndc_key_file: <%= @rndc_key_file %>
<% end -%>
<% if @clean_zonefile -%>
        clean_zonefile: true
<% end -%>
<% end -%>
<% if !(@also_notifies.empty?) -%>
  also_notifies:
<% @also_notifies.each do |also_notify| -%>
  - host: <%= also_notify %>
    port: <%= @dns_port.to_s %>
<% end -%>
<% end -%>
