30 lines
675 B
YAML
30 lines
675 B
YAML
---
|
|
- name: Install Bind9
|
|
ansible.builtin.apt:
|
|
update_cache: true
|
|
name: bind9
|
|
register: apt_result
|
|
retries: 3
|
|
until: apt_result is succeeded
|
|
|
|
- name: Deploy Bind9 configuration
|
|
ansible.builtin.template:
|
|
src: bind/{{ item }}.j2
|
|
dest: /etc/bind/{{ item }}
|
|
mode: 0640
|
|
owner: root
|
|
group: bind
|
|
loop:
|
|
- named.conf
|
|
- named.conf.local
|
|
- named.conf.key
|
|
- named.conf.options
|
|
when: item != "named.conf.key" or bind.rfc2136_keys is defined
|
|
notify: systemctl reload bind9.service
|
|
|
|
- name: Indicate role in motd
|
|
ansible.builtin.template:
|
|
src: update-motd.d/05-service.j2
|
|
dest: /etc/update-motd.d/05-bind
|
|
mode: 0755
|