summaryrefslogtreecommitdiff
path: root/roles/nameservers/tasks/main.yml
blob: 7f13ebdd8d4073d0ffae59b23c5c80436268a089 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---
- name: create named.conf.local for primary
  template:
    src: ../templates/named.conf.local.primary.j2
    dest: /etc/bind/named.conf.local
  when: inventory_hostname in groups['dnsprimary']

- name: create primary zone files for primary
  template:
    src: "../templates/{{ item.zone_file }}.j2"
    dest: "/etc/bind/{{ item.zone_file }}"
  with_items: "{{ dns_zones }}"
  when: inventory_hostname in groups['dnsprimary']

- name: create named.conf.local for replica
  template:
    src: ../templates/named.conf.local.replica.j2
    dest: /etc/bind/named.conf.local
  when: inventory_hostname in groups['dnsreplica']

- name: restart bind9
  service:
    name: bind9
    state: restarted
    enabled: true