67 lines
1.4 KiB
YAML
67 lines
1.4 KiB
YAML
---
|
|
- name: install dns server packages
|
|
apt:
|
|
name: "{{ item }}"
|
|
state: present
|
|
notify: reload systemd
|
|
with_items:
|
|
- bind9
|
|
- bind9-doc
|
|
- bind9utils
|
|
|
|
- name: enable systemd unit bind9
|
|
systemd:
|
|
name: bind9
|
|
enabled: yes
|
|
|
|
- name: write named.conf
|
|
template:
|
|
src: named.conf.j2
|
|
dest: /etc/bind/named.conf
|
|
owner: root
|
|
group: bind
|
|
mode: 0644
|
|
notify: restart bind9
|
|
|
|
- name: write named.conf.options
|
|
template:
|
|
src: named.conf.options.j2
|
|
dest: /etc/bind/named.conf.options
|
|
owner: root
|
|
group: bind
|
|
mode: 0644
|
|
notify: restart bind9
|
|
|
|
- name: write named.conf.logging
|
|
template:
|
|
src: named.conf.logging.j2
|
|
dest: /etc/bind/named.conf.logging
|
|
owner: root
|
|
group: bind
|
|
mode: 0644
|
|
notify: restart bind9
|
|
|
|
- name: write named.conf for meshes
|
|
template:
|
|
src: named.conf.mesh.j2
|
|
dest: /etc/bind/named.conf.{{ item.value.site_code }}
|
|
owner: root
|
|
group: bind
|
|
mode: 0644
|
|
notify: restart bind9
|
|
with_dict: "{{ meshes }}"
|
|
|
|
- name: write initial icvpn bind config
|
|
shell: /usr/bin/python3 /home/admin/clones/icvpn-scripts/mkdns -f bind -x mwu -x bingen -s /home/admin/clones/icvpn-meta > /etc/bind/named.conf.icvpn
|
|
args:
|
|
chdir: /home/admin/clones/icvpn-scripts
|
|
creates: /etc/bind/named.conf.icvpn
|
|
notify: restart bind9
|
|
|
|
- name: set file attributes for icvpn config
|
|
file:
|
|
path: /etc/bind/
|
|
mode: 0644
|
|
owner: root
|
|
group: bird
|
|
notify: restart bind9
|