]> git.phdru.name Git - ansible.git/blob - playbooks/debian/roles/add-dns-domain/tasks/main.yml
Refactor(add-dns-domain): Remove excessive empty lines
[ansible.git] / playbooks / debian / roles / add-dns-domain / tasks / main.yml
1 - name: Check domain
2   stat:
3     path: "/etc/bind/{{ domain }}"
4   register: domain_exists
5   changed_when: not domain_exists.stat.exists
6
7 - name: Copy domain template
8   become: true
9   template:
10     src: domain
11     dest: "/etc/bind/{{ domain }}"
12     owner: bind
13     group: bind
14     mode: '0600'
15     force: no
16   when: not domain_exists.stat.exists
17
18 - name: Update config
19   become: true
20   shell: |
21     echo 'zone "{{ domain }}" {
22           type master;
23           file "/etc/bind/{{ domain }}";
24           allow-query { any; };
25           notify yes;
26     };' >> /etc/bind/named.conf.local
27
28
29   when: not domain_exists.stat.exists
30
31 - name: Reload BIND
32   become: true
33   service:
34     name: bind9
35     state: reloaded
36   when: not domain_exists.stat.exists