]> git.phdru.name Git - ansible.git/blob - playbooks/debian/roles/named/tasks/main.yml
ded1b35ef5581a2e68648070684ffcd2887c0a33
[ansible.git] / playbooks / debian / roles / named / tasks / main.yml
1 - name: Check locales
2   shell: "grep -c '^[ \\t]\\+allow-query' /etc/bind/named.conf.options || :"
3   register: named_conf
4   changed_when: named_conf.stdout == "0"
5
6 - debug:
7     msg: "BIND has already been configured"
8   when: named_conf.stdout != "0"
9
10 - name: Install BIND
11   become: true
12   apt:
13     autoclean: yes
14     autoremove: yes
15     install_recommends: no
16     name: bind9
17     purge: yes
18     state: latest
19     update_cache: yes
20   when: named_conf.stdout == "0"
21
22 - name: Configure BIND
23   become: true
24   copy:
25     src: named.conf.options
26     dest: /etc/bind/named.conf.options
27     owner: bind
28     group: bind
29     mode: '0600'
30   when: named_conf.stdout == "0"
31
32 - name: Reload BIND
33   become: true
34   service:
35     name: bind9
36     state: reloaded
37   when: named_conf.stdout == "0"