unbound: Initial version of role
This commit is contained in:
parent
1efe20a55c
commit
c41495066b
5 changed files with 105 additions and 0 deletions
29
roles/unbound/tasks/main.yml
Normal file
29
roles/unbound/tasks/main.yml
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue