dns-witch-zones/config/roles/knot/tasks/main.yml

34 lines
561 B
YAML
Raw Normal View History

2021-06-04 13:23:13 +00:00
---
- name: Install knot
2021-07-25 15:35:08 +00:00
become: yes
2021-06-04 13:23:13 +00:00
apt:
2021-07-25 15:35:08 +00:00
update_cache: yes
2021-06-04 13:23:13 +00:00
pkg:
- knot
- knot-dnsutils
- name: Update zones
2021-07-25 15:35:08 +00:00
become: yes
2021-06-04 13:23:13 +00:00
ansible.builtin.copy:
2021-06-04 14:06:26 +00:00
src: '{{ zones_dir }}/'
2021-06-04 13:23:13 +00:00
dest: /var/lib/knot/zones
owner: knot
group: knot
mode: '0644'
notify: reload knot
2021-06-04 13:48:05 +00:00
when: "inventory_hostname in groups.primary"
2021-06-04 13:23:13 +00:00
2021-07-25 15:35:08 +00:00
- name: Deploy conf
become: yes
2021-06-04 13:23:13 +00:00
template:
src: knot.conf.j2
dest: /etc/knot/knot.conf
notify: reload knot
- name: Start knot
2021-07-25 15:35:08 +00:00
become: yes
2021-06-04 13:23:13 +00:00
service:
name: knot
state: started
enabled: yes