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

  targets:
<% @pdns4_hosts.each do |pdns4_host| -%>
    - type: pdns4
      description: PowerDNS4 DNS Server <%= pdns4_host %>

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

      options:
        host: <%= pdns4_host %>
        port: <%= @dns_port.to_s %>
        api_endpoint: <%= @api_endpoint %>
        api_token: <%= @api_token %>
  <%- if @tsigkey_name -%>
        tsigkey_name: <%= @tsigkey_name %>
  <%- end -%>
<% end -%>
<% if !(@also_notifies.empty?) -%>
  also_notifies:
<% @also_notifies.each do |also_notify| -%>
  - host: <%= also_notify %>
    port: <%= @dns_port.to_s %>
<% end -%>
<% end -%>
