29 lines
584 B
YAML
29 lines
584 B
YAML
---
|
|
- name: Ensure unbound is present
|
|
apt:
|
|
name: unbound
|
|
state: present
|
|
|
|
- fail:
|
|
msg: "Required nsd_addr is missing"
|
|
when: server.nsd_addr is not defined
|
|
|
|
- fail:
|
|
msg: "Required nsd_port is missing"
|
|
when: server.nsd_port is not defined
|
|
|
|
- name: Ensure unbound config is present
|
|
template:
|
|
src: templates/unbound.conf.j2
|
|
dest: /etc/unbound/unbound.conf
|
|
owner: root
|
|
group: root
|
|
mode: 0600
|
|
notify: restart unbound
|
|
|
|
- name: Ensure unbound service is enabled and started
|
|
systemd:
|
|
name: unbound.service
|
|
state: started
|
|
enabled: yes
|