diff options
Diffstat (limited to 'roles/nameservers/tasks/main.yml')
-rw-r--r-- | roles/nameservers/tasks/main.yml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/roles/nameservers/tasks/main.yml b/roles/nameservers/tasks/main.yml new file mode 100644 index 0000000..7f13ebd --- /dev/null +++ b/roles/nameservers/tasks/main.yml @@ -0,0 +1,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 |