You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
1.1 KiB

---
- name: BIND Install
package:
pkg: [ python-netaddr, bind9, bind9utils, dnsutils ]
state: present
- name: Create serial, based on last two digits of year, month, day, and hour
command: date +%y%m%d%H
register: bind_timestamp
changed_when: false
run_once: true
- name: BIND master config file allow recursion
copy:
content: |
allow-recursion {
10.0.0.0/8;
172.0.0.0/8;
192.168.0.0/16;
};
dest: /etc/bind/named.conf.allow-recursion
force: no
owner: root
group: bind
mode: '0640'
- name: BIND master config file
template:
src: named.conf.j2
dest: /etc/bind/named.conf
owner: root
group: bind
mode: '0640'
validate: 'named-checkconf %s'
when: bind_master is defined
notify: restart bind
- name: BIND zone file
template:
src: zone.conf.j2
dest: "/var/cache/bind/{{ bind_zone_name }}"
force: no
owner: root
group: bind
mode: '0640'
validate: 'named-checkzone -d {{ bind_zone_name }} %s'
when: bind_zone is defined
notify: restart bind