ansible/roles/unbound/tasks/main.yml

29 lines
601 B
YAML

---
- name: install packages
package:
name: unbound
state: installed
when: ansible_os_family != "OpenBSD"
- name: create control keys
command:
argv:
- unbound-control-setup
creates: /etc/unbound/unbound_control.key
notify: restart unbound
- name: copy config
copy:
dest: /etc/unbound/unbound.conf
src: "unbound.conf.{{ inventory_hostname }}"
mode: 0644
owner: root
group: "{{ ansible_wheel }}"
validate: "unbound-checkconf %s"
notify: restart unbound
- name: enable service
service:
name: unbound
state: started
enabled: true