-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rdns: add reverse dns automation for peering lan
- Loading branch information
Showing
12 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ansible_ssh_user: root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
rdns: | ||
hosts: | ||
svc-ns01.dd-ix.net: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env ansible-playbook | ||
|
||
|
||
- name: reload bird | ||
hosts: bird | ||
serial: 1 | ||
any_errors_fatal: true | ||
roles: | ||
- role: bird_reload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dependencies: | ||
- role: com_prepare | ||
- role: com_peers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
- name: Build IPv6 RDNS zone file | ||
ansible.builtin.template: | ||
src: 9.7.0.0.8.f.7.0.1.0.0.2.ip6.arpa.db.j2 | ||
dest: "{{ arouteserver_workdir }}/dist/9.7.0.0.8.f.7.0.1.0.0.2.ip6.arpa.db" | ||
register: zone_fwd | ||
|
||
- name: Update IPv6 RDNS soa file | ||
ansible.builtin.template: | ||
src: zone.soa.j2 | ||
dest: "{{ arouteserver_workdir }}/dist/9.7.0.0.8.f.7.0.1.0.0.2.ip6.arpa.soa" | ||
when: zone_fwd.changed | ||
|
||
|
||
- 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" | ||
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" | ||
when: zone_fwd.changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{ ansible_managed | comment(decoration="; ") }} | ||
|
||
$TTL 3600 | ||
|
||
$INCLUDE /var/lib/bind/64.151.201.193.in-addr.arpa.soa | ||
|
||
{% for peer in ixp_manager_peers %} | ||
{{ "%-32s"|format(peer.ipv4address|ansible.utils.ipaddr('revdns')) }} PTR {{ peer.slug|lower }}.peer.dd-ix.net. | ||
{% endfor %} |
9 changes: 9 additions & 0 deletions
9
roles/rdns_build/templates/9.7.0.0.8.f.7.0.1.0.0.2.ip6.arpa.db.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{{ ansible_managed | comment(decoration="; ") }} | ||
|
||
$TTL 3600 | ||
|
||
$INCLUDE /var/lib/bind/9.7.0.0.8.f.7.0.1.0.0.2.ip6.arpa.soa | ||
|
||
{% for peer in ixp_manager_peers %} | ||
{{ "%-32s"|format(peer.ipv6address|ansible.utils.ipaddr('revdns')) }} PTR {{ peer.slug|lower }}.peer.dd-ix.net. | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{ ansible_managed | comment(decoration="; ") }} | ||
|
||
@ SOA ns.dd-ix.net. noc.dd-ix.net. ( | ||
{{ "%-10s"|format(ansible_date_time.epoch) }} ; serial | ||
3600 ; Refresh - 1 hour | ||
7200 ; Retry - 2 hours | ||
2592000 ; Expire - 1 week | ||
1800 ) ; Minimum - 1/2 hour | ||
NS ans-01.ibh.de. | ||
NS ans-02.ibh.net. | ||
NS ans-03.ibh.de. | ||
NS ans-04.ibh.services. | ||
NS ans-05.ibh.net. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- name: Upload zone files | ||
ansible.builtin.copy: | ||
src: "{{ hostvars.localhost.arouteserver_workdir }}/dist/{{ item }}" | ||
dest: "/var/lib/bind/{{ item }}" | ||
loop: | ||
- 64.151.201.193.in-addr.arpa.db | ||
- 64.151.201.193.in-addr.arpa.soa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dependencies: | ||
- role: com_secrets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- name: Reload named | ||
ansible.builtin.service: | ||
name: bind | ||
state: reloaded |