2020-11-19 00:21:11 +01:00
|
|
|
---
|
|
|
|
|
2020-11-20 00:54:31 +01:00
|
|
|
- name: render knot master config
|
|
|
|
template:
|
|
|
|
src: etc/knot/knot.conf.j2
|
|
|
|
dest: /etc/knot/knot.conf
|
|
|
|
owner: knot
|
|
|
|
group: knot
|
|
|
|
mode: 0640
|
|
|
|
notify: reload knot
|
|
|
|
|
2020-11-20 00:58:05 +01:00
|
|
|
- name: create knot config directory
|
|
|
|
file:
|
|
|
|
path: /etc/knot/knot.d
|
|
|
|
state: directory
|
|
|
|
owner: knot
|
|
|
|
group: knot
|
|
|
|
mode: 0750
|
|
|
|
|
2020-11-20 01:34:40 +01:00
|
|
|
- name: create knot zone directory
|
|
|
|
file:
|
|
|
|
path: /var/lib/knot/master
|
|
|
|
state: directory
|
|
|
|
owner: knot
|
|
|
|
group: knot
|
|
|
|
mode: 0750
|
|
|
|
|
|
|
|
- name: render knot zone files
|
|
|
|
template:
|
|
|
|
src: var/lib/knot/master/zone.j2
|
2020-11-20 02:14:16 +01:00
|
|
|
dest: "/var/lib/knot/master/{{ zone.name }}zone"
|
2020-11-20 01:34:40 +01:00
|
|
|
owner: knot
|
|
|
|
group: knot
|
|
|
|
mode: 0640
|
2020-11-20 04:18:14 +01:00
|
|
|
validate: /usr/bin/kzonecheck -v %s
|
2020-11-20 01:34:40 +01:00
|
|
|
vars:
|
2020-11-20 02:14:16 +01:00
|
|
|
zone: "{{ hostvars[inventory_hostname]['knot_zone_' + item.1] }}"
|
2020-11-20 01:36:52 +01:00
|
|
|
loop: "{{ knot_zone_groups | subelements('zones') }}"
|
2020-11-20 01:34:40 +01:00
|
|
|
notify: reload knot
|
|
|
|
|
2020-11-20 00:54:31 +01:00
|
|
|
- name: render knot server config
|
|
|
|
template:
|
|
|
|
src: etc/knot/knot.d/00-server.conf.j2
|
|
|
|
dest: /etc/knot/knot.d/00-server.conf
|
|
|
|
owner: knot
|
|
|
|
group: knot
|
|
|
|
mode: 0640
|
|
|
|
notify: reload knot
|
|
|
|
|
|
|
|
- name: render knot master configs
|
|
|
|
template:
|
|
|
|
src: etc/knot/knot.d/10-master.conf.j2
|
|
|
|
dest: "/etc/knot/knot.d/{{ 10+i }}-master-{{ item.name }}.conf"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
|
|
|
vars:
|
|
|
|
name: "{{ item.name }}"
|
|
|
|
replicas: "{{ item.replicas }}"
|
|
|
|
zones: "{{ item.zones }}"
|
|
|
|
loop: "{{ knot_zone_groups }}"
|
|
|
|
loop_control:
|
|
|
|
index_var: i
|
|
|
|
notify: reload knot
|