unbound: Initial version of role

This commit is contained in:
Timo Makinen 2021-03-25 17:38:21 +00:00
parent 1efe20a55c
commit c41495066b
5 changed files with 105 additions and 0 deletions

View file

@ -0,0 +1,29 @@
---
- 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