2018-05-04 19:47:14 +02:00
|
|
|
---
|
|
|
|
- block:
|
|
|
|
- name: Install the unbound resolver packages
|
2019-05-30 19:04:52 +02:00
|
|
|
apt: pkg={{ unbound_pkgs }} state=latest cache_valid_time=1800 update_cache=yes
|
2018-05-04 19:47:14 +02:00
|
|
|
|
|
|
|
- name: Install the unbound config files
|
|
|
|
template: src={{ item }} dest=/etc/unbound/unbound.conf.d/{{ item }}
|
|
|
|
with_items:
|
|
|
|
- unbound-server.conf
|
|
|
|
- unbound-remote-control.conf
|
|
|
|
notify: Restart unbound
|
|
|
|
|
2019-05-30 19:04:52 +02:00
|
|
|
- name: On bionic, stop systemd-resolvd because it interferes
|
|
|
|
service: name=systemd-resolved state=stopped enabled=no
|
|
|
|
when:
|
|
|
|
- ansible_distribution == "Ubuntu"
|
|
|
|
- ansible_service_mgr == 'systemd'
|
|
|
|
- ansible_distribution_major_version >= '18'
|
|
|
|
|
2018-05-04 19:47:14 +02:00
|
|
|
- name: Ensure that the unbound service is started and enabled
|
2019-05-30 19:04:52 +02:00
|
|
|
service: name=unbound state=restarted enabled=yes
|
2018-05-04 19:47:14 +02:00
|
|
|
|
2019-05-30 19:04:52 +02:00
|
|
|
tags: [ 'unbound' ]
|