Make updaters zone key optional

This commit is contained in:
s3lph 2021-02-05 21:47:29 +01:00
parent 7cdd070ad4
commit eab820a60a

View file

@ -24,7 +24,7 @@ log:
# #
key: key:
{% for remote in ( (zones | map(attribute='replicas') ) + (zones | map(attribute='masters') ) + (zones | map(attribute='updaters') ) ) | flatten | unique %} {% for remote in ( (zones | map(attribute='replicas') ) + (zones | map(attribute='masters') ) + (zones | map(attribute='updaters', default=[]) ) ) | flatten | unique %}
- id: {{ hostvars[remote].knot_tsig_key.name }} - id: {{ hostvars[remote].knot_tsig_key.name }}
algorithm: {{ hostvars[remote].knot_tsig_key.algorithm }} algorithm: {{ hostvars[remote].knot_tsig_key.algorithm }}
@ -33,7 +33,7 @@ key:
remote: remote:
{% for remote in ( (zones | map(attribute='replicas') ) + (zones | map(attribute='masters') ) + (zones | map(attribute='updaters') ) ) | flatten | unique %} {% for remote in ( (zones | map(attribute='replicas') ) + (zones | map(attribute='masters') ) + (zones | map(attribute='updaters', default=[]) ) ) | flatten | unique %}
- id: remote-{{ remote }} - id: remote-{{ remote }}
{% for address in hostvars[remote].knot_dns_addresses %} {% for address in hostvars[remote].knot_dns_addresses %}
@ -68,7 +68,7 @@ acl:
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% for remote in zones | map(attribute='updaters') | flatten | unique %} {% for remote in zones | map(attribute='updaters', default=[]) | flatten | unique %}
- id: acl-update-{{ remote }} - id: acl-update-{{ remote }}
action: update action: update
@ -108,6 +108,9 @@ zone:
{% for replica in zone.replicas %} {% for replica in zone.replicas %}
acl: acl-xfr-{{ replica }} acl: acl-xfr-{{ replica }}
{% endfor %} {% endfor %}
{% for updater in zone.updaters | default([]) %}
acl: acl-update-{{ updater }}
{% endfor %}
{% for replica in zone.replicas %} {% for replica in zone.replicas %}
notify: remote-{{ replica }} notify: remote-{{ replica }}
{% endfor %} {% endfor %}
@ -127,7 +130,7 @@ zone:
storage: {{ knot_zone_replica_storage_path }} storage: {{ knot_zone_replica_storage_path }}
serial-policy: unixtime serial-policy: unixtime
{% for master in zone.masters %} {% for master in zone.masters %}
acl: acl-xfr-{{ master }} acl: acl-notify-{{ master }}
{% endfor %} {% endfor %}
{% for master in zone.masters %} {% for master in zone.masters %}
master: remote-{{ master }} master: remote-{{ master }}