Tweaks
This commit is contained in:
parent
1a0b2614bc
commit
bf265a8309
5 changed files with 13 additions and 18 deletions
|
@ -17,8 +17,9 @@
|
|||
|
||||
## LAN IP address range:
|
||||
ipaddr_lan: 192.168.0.10/24
|
||||
ipaddr_lan_threeoct: "{{ ipaddr_lan.split('.')[0:3] | join('.')}}"
|
||||
ipaddr_lan_ptr: "{{ ipaddr_lan | ansible.netcommon.ipaddr('revdns').split('.')[1:-1] | join('.') }}"
|
||||
ipaddr_lan_threeoct: "{{ ipaddr_lan.split('.')[0:3] | join('.') }}"
|
||||
ipaddr_lan_ptr: "{{ (ipaddr_lan | ipaddr('revdns')).split('.')[1:] | join('.') }}"
|
||||
ipaddr_lan_ptr_threeoct: "{{ ipaddr_lan_ptr.split('.')[0:3] | join('.') }}"
|
||||
dhcp_range: 192.168.0.50,192.168.0.99,2h
|
||||
|
||||
di_dist: "{{ ansible_distribution_release }}"
|
||||
|
|
|
@ -42,10 +42,15 @@
|
|||
dest: "/etc/bind/{{ item }}"
|
||||
loop:
|
||||
- db.intern
|
||||
- db.lan
|
||||
- localzones
|
||||
notify: restart bind
|
||||
|
||||
- name: deploy config files for bind9 - special case where template destination filename is dynamic
|
||||
template:
|
||||
src: db.lan.j2
|
||||
dest: "/etc/bind/db.{{ ipaddr_lan_threeoct }}"
|
||||
notify: restart bind
|
||||
|
||||
- name: link zone files to writeable directory for DDNS
|
||||
file:
|
||||
src: "/etc/bind/{{ item }}"
|
||||
|
@ -53,7 +58,7 @@
|
|||
state: link
|
||||
loop:
|
||||
- db.intern
|
||||
- db.lan
|
||||
- "db.{{ ipaddr_lan_threeoct }}"
|
||||
notify: restart bind
|
||||
|
||||
- name: enable local bind config
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
$TTL 500
|
||||
@ IN SOA {{ ansible_fqdn }}. root.{{ ansible_domain }}. (
|
||||
1 ; Serial
|
||||
3600 ; Refresh
|
||||
1800 ; Retry
|
||||
720000 ; Expire
|
||||
6400 ) ; Negative Cache TTL
|
||||
;
|
||||
@ NS {{ ansible_fqdn }}.
|
||||
MX 10 {{ ansible_fqdn }}.
|
||||
{{ ipaddr_lan | ipaddr("address") | regex_replace("^.*\.(.+$)", "\\1") }} PTR {{ ansible_fqdn }}.
|
|
@ -26,7 +26,7 @@ zone intern. {
|
|||
key rndc-key;
|
||||
}
|
||||
|
||||
zone "{{ ipaddr_lan_ptr }}" {
|
||||
zone {{ ipaddr_lan_ptr }} {
|
||||
primary 127.0.0.1;
|
||||
key rndc-key;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ if option arch = 00:07 {
|
|||
filename "d-i/n-a/pxelinux.0";
|
||||
}
|
||||
|
||||
subnet {{ ipaddr_lan | ipaddr("address") }} netmask {{ ipaddr_lan | ipaddr("netmask") }} {
|
||||
subnet {{ ipaddr_lan | ipaddr("network") }} netmask {{ ipaddr_lan | ipaddr("netmask") }} {
|
||||
option routers {{ ipaddr_lan | ipaddr("address") }};
|
||||
range {{ dhcp_start }} {{ dhcp_stop }};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
include "/etc/bind/rndc.key";
|
||||
|
||||
zone "{{ ipaddr_lan_ptr }}" {
|
||||
zone "{{ ipaddr_lan_ptr[:-1] }}" {
|
||||
type master;
|
||||
notify no;
|
||||
file "/etc/bind/db.{{ ipaddr_lan_threeoct }}";
|
||||
|
|
Loading…
Add table
Reference in a new issue