// {{ ansible_managed }}
{% if named_key_mapping | length > 0 %}
{% for primary in named_key_mapping.keys() %}
server {{ primary }} {
  keys { {{ named_key_mapping[primary] }}; };
};
{% endfor %}

{% endif %}
server {{ ansible_default_ipv4.address }} {
  keys { {% for mykey in named_dns_keys %} {{ mykey.name }}; {% endfor %} };
};

{% for mykey in named_dns_keys %}
key {{ mykey.name }} {
  algorithm {{ mykey.algorithm }};
  secret "{{ mykey.secret }}";
};
{% endfor %}
