First test version

master
Oleg Vasilev 2021-12-23 01:36:15 +03:00
parent 0d58fd35bd
commit 481bc2e7d4
6 changed files with 58 additions and 2 deletions

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) <year> <copyright holders>
Copyright (c) 2021 Vasiliev "Zmey!" Oleg
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View File

@ -1,3 +1,7 @@
# unbound
Ansible role for unbound
Ansible role for unbound
### Variables
Set `unbound_config_template` to templatefile you want deploy as unbound configuration

6
handlers/main.yml Normal file
View File

@ -0,0 +1,6 @@
---
- name: unbound | Reload configuration
service:
name: unbound
state: reloaded

28
tasks/main.yml Normal file
View File

@ -0,0 +1,28 @@
---
- name: unbound | Load system-specific vars
include_vars: "{{ ansible_system | lower }}.yml"
- name: unbound | Install package
package:
name: unbound
state: present
- name: unbound | Deploy config
template:
src: "{{ unbound_config_template }}"
dest: "{{ unbound_config.path }}"
mode: "{{ unbound_config.mode }}"
owner: "{{ unbound_config.owner }}"
group: "{{ unbound_config.group }}"
validate: "unbound-checkconf %s"
notify: unbound | Reload configuration
- name: unbound | Enable and start unbound
service:
name: unbound
state: started
enabled: yes
- name: unbound | Run handlers
meta: flush_handlers

9
vars/linux.yml Normal file
View File

@ -0,0 +1,9 @@
---
unbound_package_name: unbound
unbound_config:
path: /etc/unbound/unbound.conf
mode: 0600
owner: unbound
group: unbound

9
vars/openbsd.yml Normal file
View File

@ -0,0 +1,9 @@
---
unbound_package_name: unbound
unbound_config:
path: /var/unbound/etc/unbound.conf
mode: 644
owner: root
group: wheel