ansible/roles/knot/tasks/main.yaml

41 lines
1.2 KiB
YAML
Raw Normal View History

2024-01-20 01:26:37 +00:00
---
- name: Make sure handlers are flushed immediately
meta: flush_handlers
- name: Load a variable file based on the OS type
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_major_version'] }}.yaml"
- "{{ ansible_facts['distribution'] }}-{{ ansible_facts['distribution_version'] }}.yaml"
- "{{ ansible_facts['os_family'] }}-{{ ansible_facts['distribution_major_version'] }}.yaml"
- "{{ ansible_facts['os_family'] }}-{{ ansible_facts['distribution_version'] }}.yaml"
- "{{ ansible_facts['distribution'] }}.yaml"
- "{{ ansible_facts['os_family'] }}.yaml"
- main.yaml
paths:
- "vars"
tags: knot_vars
- name: Include knot install for {{ ansible_distribution }}
include_tasks: "{{ ansible_facts['os_family'] }}.yaml"
- name: Configure knot
copy:
content: "{{ knot_conf }}"
dest: /etc/knot/knot.conf
mode: 0640
owner: "root"
group: "knot"
validate: "knotc -c %s conf-check"
notify: Restart knot
- name: Enable and start knot
systemd:
name: "knot"
enabled: true
state: started
masked: false
daemon_reload: true