2017-06-01 14:07:11 +02:00
|
|
|
---
|
|
|
|
- name: Install Unbound package
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.apt:
|
2023-12-08 16:13:41 +01:00
|
|
|
name:
|
|
|
|
- unbound
|
|
|
|
- unbound-anchor
|
|
|
|
- dns-root-data
|
2017-06-01 14:07:11 +02:00
|
|
|
state: present
|
2023-12-19 17:55:36 +01:00
|
|
|
cache_valid_time: 3600
|
2017-06-01 14:07:11 +02:00
|
|
|
tags:
|
2023-12-08 16:13:41 +01:00
|
|
|
- unbound
|
2017-06-01 14:07:11 +02:00
|
|
|
|
2023-12-08 16:13:41 +01:00
|
|
|
- name: Copy Unbound config
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: evolinux.conf.j2
|
|
|
|
dest: /etc/unbound/unbound.conf.d/evolinux.conf
|
|
|
|
owner: root
|
|
|
|
group: root
|
2018-01-11 12:41:40 +01:00
|
|
|
mode: "0644"
|
2023-12-08 16:13:41 +01:00
|
|
|
notify: Reload unbound
|
2018-01-11 12:41:40 +01:00
|
|
|
tags:
|
2023-12-08 16:13:41 +01:00
|
|
|
- unbound
|
2018-01-11 12:41:40 +01:00
|
|
|
|
2023-12-08 16:13:41 +01:00
|
|
|
- name: Copy Unbound config for reloading (Debian 11 and older)
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.template:
|
2023-12-08 16:13:41 +01:00
|
|
|
src: evolinux-reload.conf.j2
|
|
|
|
dest: /etc/unbound/unbound.conf.d/evolinux-reload.conf
|
2017-06-01 14:07:11 +02:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0644"
|
2023-12-08 16:13:41 +01:00
|
|
|
when:
|
|
|
|
- ansible_distribution_major_version is version('11', '<=')
|
|
|
|
notify: Restart unbound
|
|
|
|
tags:
|
|
|
|
- unbound
|
|
|
|
|
|
|
|
- name: Copy munin plugin config
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: munin-plugin.conf
|
|
|
|
dest: /etc/munin/plugin-conf.d/unbound
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0644"
|
|
|
|
tags:
|
|
|
|
- unbound
|
|
|
|
|
|
|
|
- name: Enable unbound munin plugin
|
|
|
|
ansible.builtin.file:
|
|
|
|
src: /usr/share/munin/plugins/unbound_munin_
|
|
|
|
dest: "/etc/munin/plugins/unbound_munin_{{ plugin_name }}"
|
|
|
|
state: link
|
|
|
|
loop:
|
|
|
|
- hits
|
|
|
|
- queue
|
|
|
|
- memory
|
|
|
|
- by_type
|
|
|
|
- by_class
|
|
|
|
- by_opcode
|
|
|
|
- by_rcode
|
|
|
|
- by_flags
|
|
|
|
- histogram
|
|
|
|
loop_control:
|
|
|
|
loop_var: plugin_name
|
|
|
|
notify: Restart munin-node
|
2017-06-01 14:07:11 +02:00
|
|
|
tags:
|
2023-12-08 16:13:41 +01:00
|
|
|
- unbound
|
2017-06-01 14:07:11 +02:00
|
|
|
|
|
|
|
- name: Starting and enabling Unbound
|
2023-03-20 23:33:19 +01:00
|
|
|
ansible.builtin.service:
|
2017-06-01 14:07:11 +02:00
|
|
|
name: unbound
|
2023-12-08 16:13:41 +01:00
|
|
|
enabled: true
|
2017-06-01 14:07:11 +02:00
|
|
|
state: started
|
|
|
|
tags:
|
2023-12-08 16:13:41 +01:00
|
|
|
- unbound
|