ansible-role-bind/tasks/base.yml

61 lines
1 KiB
YAML
Raw Normal View History

---
2018-03-28 15:45:57 +00:00
- name: install packages for bind9
apt:
2018-12-05 09:16:43 +00:00
name: '{{ packages }}'
2018-03-28 15:45:57 +00:00
state: present
2018-12-05 09:16:43 +00:00
vars:
packages:
- bind9
- bind9-host
- cron
register: result
retries: 3
delay: 1
until: result is success
2018-03-28 15:45:57 +00:00
- name: create zone directory
file:
path: /etc/bind/zones
owner: bind
group: bind
mode: 0700
state: directory
- name: create log directory
file:
path: /var/log/named
owner: bind
group: bind
mode: 0700
state: directory
- name: copy bind configuration files
template:
src: '{{ item }}.j2'
dest: '/etc/bind/{{ item }}'
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
notify: restart bind
- name: create keys directory
file:
path: /etc/bind/keys
owner: root
group: bind
mode: 0750
state: directory
2018-08-08 19:06:55 +00:00
- name: add cron dnssec
template:
src: dnssec.j2
dest: /etc/cron.weekly/dnssec
owner: root
group: root
mode: 0700
tags: bind