ansible-role-bind/tasks/base.yml

55 lines
1,019 B
YAML
Raw Normal View History

---
2023-06-30 09:16:45 +00:00
- name: Install packages for bind9
ansible.builtin.package:
name:
2018-12-05 09:16:43 +00:00
- bind9
- bind9-host
- cron
2023-06-30 09:16:45 +00:00
state: present
2018-03-28 15:45:57 +00:00
2023-06-30 09:16:45 +00:00
- name: Create zone directory
ansible.builtin.file:
2018-03-28 15:45:57 +00:00
path: /etc/bind/zones
owner: bind
group: bind
mode: 0700
state: directory
2023-06-30 09:16:45 +00:00
- name: Create log directory
ansible.builtin.file:
2018-03-28 15:45:57 +00:00
path: /var/log/named
owner: bind
group: bind
mode: 0700
state: directory
2023-06-30 09:16:45 +00:00
- name: Copy bind configuration files
ansible.builtin.template:
src: "{{ item }}.j2"
dest: "/etc/bind/{{ item }}"
2018-03-28 15:45:57 +00:00
owner: root
group: root
mode: 0644
2018-12-05 09:16:43 +00:00
loop:
2018-03-28 15:45:57 +00:00
- named.conf
- named.conf.options
- named.conf.local
2023-06-30 09:16:45 +00:00
notify: Restart bind
2018-03-28 15:45:57 +00:00
2023-06-30 09:16:45 +00:00
- name: Create keys directory
ansible.builtin.file:
2018-03-28 15:45:57 +00:00
path: /etc/bind/keys
owner: root
group: bind
mode: 0750
state: directory
2018-08-08 19:06:55 +00:00
2023-06-30 09:16:45 +00:00
- name: Add cron dnssec
ansible.builtin.template:
2018-08-08 19:06:55 +00:00
src: dnssec.j2
dest: /etc/cron.weekly/dnssec
owner: root
group: root
mode: 0700
tags: bind