unbound(role): update readme and move task block to top level and remove unused
This commit is contained in:
parent
031fa6af9c
commit
0fb738411c
4 changed files with 68 additions and 72 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
# Unbound DNS resolver
|
# Unbound DNS resolver
|
||||||
|
|
||||||
Role fora a validating, recursive, caching DNS resolver based on [Unbound](https://nlnetlabs.nl/projects/unbound/about/).
|
Role for a validating, recursive, caching DNS resolver based on [Unbound](https://nlnetlabs.nl/projects/unbound/about/).
|
||||||
It is designed to be fast and lean and incorporates modern features based on open standards.
|
It is designed to be fast and lean and incorporates modern features based on open standards.
|
||||||
|
|
||||||
- [Documentation](https://unbound.docs.nlnetlabs.nl/en/latest/)
|
- [Documentation](https://unbound.docs.nlnetlabs.nl/en/latest/)
|
||||||
|
|
@ -9,12 +9,18 @@ It is designed to be fast and lean and incorporates modern features based on ope
|
||||||
|
|
||||||
The following variables can be used to customize this role:
|
The following variables can be used to customize this role:
|
||||||
|
|
||||||
| Variable | Type | Default | Description |
|
- `unbound_install_prometheus_exporter`: Boolean of whether [Unbound Exporter](https://github.com/letsencrypt/unbound_exporter) should also be installed to expose resolver statistics in prometheus format.
|
||||||
|------------------------------------------|-----------------|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
Defaults to `true`.
|
||||||
| unbound_install_prometheus_exporter | Boolean | `true` | Whether [Unbound Exporter](https://github.com/letsencrypt/unbound_exporter) should also be installed to expose resolver statistics in prometheus format. |
|
- `unbound_bind_interfaces`: List of interface names or IP addresseson which unbound will listen for dns queries.
|
||||||
| unbound_bind_interfaces | List of Strings | `[0.0.0.0, ::]` | List of interface names or IP addresses on which unbound will listen for dns queries |
|
Defaults to `[0.0.0.0, ::]`.
|
||||||
| unbound_enable_unbound_control | Boolean | `true` | Whether the [remote control](https://unbound.docs.nlnetlabs.nl/en/latest/getting-started/configuration.html#set-up-remote-control) feature of unbound should be configured. |
|
- `unbound_enable_unbound_control`: Boolean of whether the [remote control](https://unbound.docs.nlnetlabs.nl/en/latest/getting-started/configuration.html#set-up-remote-control) feature of unbound should be configured.
|
||||||
| unbound_enable_dnssec | Boolean | `true` | Whether dnssec validation should be enabled |
|
Defaults to `true`.
|
||||||
| unbound_access_control | List of Strings | `[]` | **Required** List of [unbound access control values](https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound.conf.html#:~:text=access-control:%20%3CIP%20netblock%3E%20%3Caction%3E) |
|
- `unbound_enable_dnssec`: Boolean of whether dnssec validation should be enabled.
|
||||||
| unbound_disable_systemd_networkd | Boolean | `true` | If true, systemd-networkd is disabled and the local system is pointed towards the configured dns resolver. |
|
Defaults to `true`.
|
||||||
| unbound_thread_count | Integer | Max vCPU Count | The number of threads unbound uses |
|
- `unbound_access_control`: **Required** List of [unbound access control values](https://unbound.docs.nlnetlabs.nl/en/latest/manpages/unbound.conf.html#:~:text=access-control:%20%3CIP%20netblock%3E%20%3Caction%3E).
|
||||||
|
Defaults to `[]`.
|
||||||
|
- `unbound_disable_systemd_networkd`: Boolean if true, systemd-networkd is disabled and the local system is pointed towards the configured dns resolver.
|
||||||
|
Defaults to `true`.
|
||||||
|
- `unbound_thread_count`: The number of threads unbound uses.
|
||||||
|
Defaults to max vCPU Count.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
nameserver 127.0.0.1
|
|
||||||
|
|
@ -4,12 +4,6 @@
|
||||||
name: unbound.service
|
name: unbound.service
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
||||||
- name: unbound.reloaded
|
|
||||||
become: true
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
name: unbound.service
|
|
||||||
state: reloaded
|
|
||||||
|
|
||||||
- name: prometheus-unbound-exporter.restarted
|
- name: prometheus-unbound-exporter.restarted
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,14 @@
|
||||||
- name: unbound role main
|
- name: install unbound dns resolver
|
||||||
block:
|
|
||||||
|
|
||||||
- name: install unbound dns resolver
|
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: unbound
|
name: unbound
|
||||||
|
|
||||||
- name: install unbound-anchor
|
- name: install unbound-anchor
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: unbound-anchor
|
name: unbound-anchor
|
||||||
|
|
||||||
- name: ensure correct directory permissions
|
- name: ensure correct directory permissions
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /etc/unbound
|
path: /etc/unbound
|
||||||
|
|
@ -21,7 +18,7 @@
|
||||||
owner: unbound
|
owner: unbound
|
||||||
group: unbound
|
group: unbound
|
||||||
|
|
||||||
- name: configure unbound dns resolver
|
- name: configure unbound dns resolver
|
||||||
become: true
|
become: true
|
||||||
notify: unbound.restarted
|
notify: unbound.restarted
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|
@ -31,7 +28,7 @@
|
||||||
group: unbound
|
group: unbound
|
||||||
mode: u=rw,g=r,o=r
|
mode: u=rw,g=r,o=r
|
||||||
|
|
||||||
- name: disable systemd-resolved
|
- name: disable systemd-resolved
|
||||||
when: unbound_disable_systemd_networkd
|
when: unbound_disable_systemd_networkd
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: deploy_systemd_resolved_config
|
name: deploy_systemd_resolved_config
|
||||||
|
|
@ -40,16 +37,16 @@
|
||||||
deploy_systemd_resolved_config__dns:
|
deploy_systemd_resolved_config__dns:
|
||||||
- 127.0.0.1
|
- 127.0.0.1
|
||||||
|
|
||||||
- name: flush handlers
|
- name: flush handlers
|
||||||
ansible.builtin.meta: flush_handlers
|
ansible.builtin.meta: flush_handlers
|
||||||
|
|
||||||
- name: ensure unbound is running and enabled
|
- name: ensure unbound is running and enabled
|
||||||
become: true
|
become: true
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
name: unbound.service
|
name: unbound.service
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
- name: install and configure prometheus-exporter for unbound
|
- name: install and configure prometheus-exporter for unbound
|
||||||
ansible.builtin.import_tasks: prometheus-exporter.yml
|
ansible.builtin.import_tasks: prometheus-exporter.yml
|
||||||
when: unbound_install_prometheus_exporter
|
when: unbound_install_prometheus_exporter
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue