Skip to content

Commit

Permalink
rdns: refactor ipv4 zone according to RFC2317
Browse files Browse the repository at this point in the history
  • Loading branch information
liske committed Aug 28, 2024
1 parent 568fdb5 commit 0f10c28
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions roles/rdns_build/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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 %}
9 changes: 0 additions & 9 deletions roles/rdns_build/templates/64.151.201.193.in-addr.arpa.db.j2

This file was deleted.

4 changes: 2 additions & 2 deletions roles/rdns_push/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0f10c28

Please sign in to comment.