ansible-infra/roles/knot/tasks/02-configure.yaml
lilly 4bdd36b8f7
update knot role to support more operational variety
Now secondary zones, dynamic zones, interpeted catalog zones, etc.
are supported by our knot role
2026-09-11 10:52:33 +02:00

36 lines
841 B
YAML

---
- name: Ensure required directories exist
become: true
loop: [ "/etc/knot", "/etc/knot/zones" ]
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: knot
group: knot
mode: u=rwx,g=rx,o=
- name: Deploy knot configuration file
become: true
notify: reload knot
ansible.builtin.template:
src: knot.conf.j2
dest: /etc/knot/knot.conf
owner: knot
group: knot
mode: u=rw,g=r,o=
- name: Deploy configured zones
become: true
notify: reload knot
loop: "{{ knot__primary_zones }}"
loop_control:
label: "{{ item.domain }}"
vars:
zone_content: "{{ item.content }}"
ansible.builtin.template:
src: zone.j2
dest: "/etc/knot/zones/{{ item.domain }}zone"
owner: knot
group: knot
mode: u=rw,g=r
validate: "kzonecheck -v -o '{{ item.domain }}' %s"