From 0f10c28ec9856742579e2f53e5fdbcff51e99b69 Mon Sep 17 00:00:00 2001 From: Thomas Liske Date: Wed, 28 Aug 2024 22:52:21 +0200 Subject: [PATCH] rdns: refactor ipv4 zone according to RFC2317 https://apps.db.ripe.net/docs/RPSL-Object-Types/Descriptions-of-Primary-Objects/#description-of-the-domain-object --- roles/rdns_build/tasks/main.yml | 6 +++--- .../templates/64-127.151.201.193.in-addr.arpa.db.j2 | 9 +++++++++ .../templates/64.151.201.193.in-addr.arpa.db.j2 | 9 --------- roles/rdns_push/tasks/main.yml | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 roles/rdns_build/templates/64-127.151.201.193.in-addr.arpa.db.j2 delete mode 100644 roles/rdns_build/templates/64.151.201.193.in-addr.arpa.db.j2 diff --git a/roles/rdns_build/tasks/main.yml b/roles/rdns_build/tasks/main.yml index e20cf45..ebedd79 100644 --- a/roles/rdns_build/tasks/main.yml +++ b/roles/rdns_build/tasks/main.yml @@ -13,12 +13,12 @@ - name: Build IPv4 RDNS zone file ansible.builtin.template: - src: 64.151.201.193.in-addr.arpa.db.j2 - dest: "{{ arouteserver_workdir }}/dist/64.151.201.193.in-addr.arpa.db" + src: 64-127.151.201.193.in-addr.arpa.db.j2 + dest: "{{ arouteserver_workdir }}/dist/64-127.151.201.193.in-addr.arpa.db" register: zone_fwd - name: Update IPv4 RDNS soa file ansible.builtin.template: src: zone.soa.j2 - dest: "{{ arouteserver_workdir }}/dist/64.151.201.193.in-addr.arpa.soa" + dest: "{{ arouteserver_workdir }}/dist/64-127.151.201.193.in-addr.arpa.soa" when: zone_fwd.changed diff --git a/roles/rdns_build/templates/64-127.151.201.193.in-addr.arpa.db.j2 b/roles/rdns_build/templates/64-127.151.201.193.in-addr.arpa.db.j2 new file mode 100644 index 0000000..5c98965 --- /dev/null +++ b/roles/rdns_build/templates/64-127.151.201.193.in-addr.arpa.db.j2 @@ -0,0 +1,9 @@ +{{ ansible_managed | comment(decoration="; ") }} + +$TTL 3600 + +$INCLUDE /var/lib/bind/ixp-deploy/64-127.151.201.193.in-addr.arpa.soa + +{% for peer in ixp_manager_peers %} +{{ "%-36s"|format(peer.ipv4address|ansible.utils.ipaddr('revdns')|regex_replace('^(\d+)\\.', '\\1.64-127.')) }} PTR {{ peer.slug|lower }}.{{ peer.switchname|regex_replace('^ixp-([^-]+)-sw\d+$', '\\1') }}.peer.dd-ix.net. +{% endfor %} diff --git a/roles/rdns_build/templates/64.151.201.193.in-addr.arpa.db.j2 b/roles/rdns_build/templates/64.151.201.193.in-addr.arpa.db.j2 deleted file mode 100644 index c47d0e1..0000000 --- a/roles/rdns_build/templates/64.151.201.193.in-addr.arpa.db.j2 +++ /dev/null @@ -1,9 +0,0 @@ -{{ ansible_managed | comment(decoration="; ") }} - -$TTL 3600 - -$INCLUDE /var/lib/bind/ixp-deploy/64.151.201.193.in-addr.arpa.soa - -{% for peer in ixp_manager_peers %} -{{ "%-32s"|format(peer.ipv4address|ansible.utils.ipaddr('revdns')|regex_replace('^(\d+)\\.', '\\1.64.')) }} PTR {{ peer.slug|lower }}.{{ peer.switchname|regex_replace('^ixp-([^-]+)-sw\d+$', '\\1') }}.peer.dd-ix.net. -{% endfor %} diff --git a/roles/rdns_push/tasks/main.yml b/roles/rdns_push/tasks/main.yml index 1470f7c..22d144f 100644 --- a/roles/rdns_push/tasks/main.yml +++ b/roles/rdns_push/tasks/main.yml @@ -3,7 +3,7 @@ src: "{{ hostvars.localhost.arouteserver_workdir }}/dist/{{ item }}" dest: "/var/lib/bind/ixp-deploy/{{ item }}" loop: - - 64.151.201.193.in-addr.arpa.db - - 64.151.201.193.in-addr.arpa.soa + - 64-127.151.201.193.in-addr.arpa.db + - 64-127.151.201.193.in-addr.arpa.soa - 9.7.0.0.8.f.7.0.1.0.0.2.ip6.arpa.db - 9.7.0.0.8.f.7.0.1.0.0.2.ip6.arpa.soa