From 55ad1892a961e0064f764d68457486d66c01b770 Mon Sep 17 00:00:00 2001 From: s3lph Date: Tue, 4 Apr 2023 23:50:08 +0200 Subject: [PATCH] Add support for secondary-to-secondary replication --- galaxy.yml | 2 +- roles/knot/templates/etc/knot/knot.conf.j2 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/galaxy.yml b/galaxy.yml index 464f8aa..6c9d0bc 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -7,7 +7,7 @@ namespace: s3lph name: nameserver # The version of the collection. Must be compatible with semantic versioning -version: "0.3.5" +version: "0.3.6" # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md diff --git a/roles/knot/templates/etc/knot/knot.conf.j2 b/roles/knot/templates/etc/knot/knot.conf.j2 index ad26447..bc30f40 100644 --- a/roles/knot/templates/etc/knot/knot.conf.j2 +++ b/roles/knot/templates/etc/knot/knot.conf.j2 @@ -48,7 +48,7 @@ remote: {% endfor %} acl: -{% for remote in zones | map(attribute='replicas') | flatten | unique %} +{% for remote in (zones | map(attribute='replicas') ) + (zones | map(attribute='replicate') | map(attribute=inventory_hostname) | default([]) ) | flatten | unique %} - id: acl-xfr-{{ remote }} action: transfer @@ -56,7 +56,7 @@ acl: key: {{ hostvars[remote].knot_tsig_key.name }} {% endif %} {% for address in hostvars[remote].knot_dns_addresses %} - address: "{{ address }}" + address: "{{ address.split('@')[0] }}" {% endfor %} {% endfor %} @@ -137,7 +137,7 @@ zone: acl: acl-update-{{ updater }} {% endfor %} {% endif %} -{% for replica in zone.replicas %} +{% for replica in zone.replicas + ( (zone.replicate | default({}) )[inventory_hostname] | default([]) ) %} notify: remote-{{ replica }} {% endfor %} {% endif %}