ansible-install-server/roles/fai/tasks/unbound.yml

72 lines
1.6 KiB
YAML
Raw Normal View History

2022-12-07 13:52:06 +00:00
- name: "Ensure systemd-resolved is stopped and disabled"
2022-12-10 18:58:32 +00:00
ansible.builtin.service:
2022-12-07 13:52:06 +00:00
name: systemd-resolved
enabled: false
state: stopped
when:
- "'systemd-resolved' in ansible_facts.packages"
2022-12-07 22:46:27 +00:00
tags:
- systemd-resolved_disable
2022-12-07 13:52:06 +00:00
- name: "Install DNS - unbound server"
become: true
ansible.builtin.package:
2020-08-26 10:10:36 +00:00
name: unbound
2022-12-07 13:52:06 +00:00
state: latest
tags:
- unbound_install
- name: "Configure DNS - remote control"
become: true
ansible.builtin.template:
src: "etc/unbound/unbound.conf.d/remote.conf"
dest: "/etc/unbound/unbound.conf.d/remote.conf"
mode: '0644'
owner: root
group: root
validate: "unbound-checkconf %s"
notify: restart unbound
when:
- false
2022-12-07 22:46:27 +00:00
tags:
- unbound_configure
2022-12-07 13:52:06 +00:00
- name: "Configure DNS - zone '{{ domain_name }}'"
become: true
ansible.builtin.template:
src: "etc/unbound/unbound.conf.d/fai.conf"
dest: "/etc/unbound/unbound.conf.d/fai.conf"
mode: '0644'
owner: root
group: root
validate: "unbound-checkconf %s"
notify: restart unbound
tags:
- unbound_configure
2020-08-26 10:10:36 +00:00
2022-12-07 13:52:06 +00:00
- name: "Configure DNS - disable IPv6 to avoid trouble with vagrant"
become: true
ansible.builtin.copy:
2020-08-26 10:10:36 +00:00
content: |
server:
2022-12-07 13:52:06 +00:00
### DISABLE BIND TO IPV6 TO AVOID TROUBLE WITH VAGRANT
do-ip6: no
dest: "/etc/unbound/unbound.conf.d/ipv6_disabled.conf"
mode: '0644'
2020-08-26 10:10:36 +00:00
owner: root
group: root
2022-12-07 13:52:06 +00:00
validate: "unbound-checkconf %s"
notify: restart unbound
tags:
- unbound_configure
2020-08-26 10:10:36 +00:00
2022-12-07 13:52:06 +00:00
- name: "Start and enable unbound"
become: true
ansible.builtin.service:
name: unbound
enabled: true
2022-12-07 13:52:06 +00:00
state: started
tags:
- unbound_enable