You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
610 B
YAML

---
- name: Install required packages
apt:
state: present
name:
- bind9
- name: Create directory for zone databases
file:
path: "{{ dns_zones_directory }}"
state: directory
- name: Configure bind9 options
template:
src: named.conf.options
dest: "{{ dns_options_configuration }}"
owner: root
group: root
mode: "u=rw,g=r,o=r"
notify: reload bind9
- name: Enable bind9 service
systemd:
name: bind9
state: started
enabled: yes
- name: Allow dns in firewall
ufw:
rule: allow
port: 53
proto: "{{ item }}"
loop:
- tcp
- udp