summaryrefslogtreecommitdiff
path: root/roles/nameservers/tasks/main.yml
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-01-02 02:10:54 -0500
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-01-02 02:10:54 -0500
commit1f9f2b7608d3915d2f8a3a556db19c27040d3a4d (patch)
treee3efd09f152de0392ec493111f07be1080830c26 /roles/nameservers/tasks/main.yml
parentc0ed0a948fd574208a44b2cfb5f944cf45efca29 (diff)
downloadoldinfra-1f9f2b7608d3915d2f8a3a556db19c27040d3a4d.tar.gz
oldinfra-1f9f2b7608d3915d2f8a3a556db19c27040d3a4d.zip
working dns
Diffstat (limited to 'roles/nameservers/tasks/main.yml')
-rw-r--r--roles/nameservers/tasks/main.yml21
1 files changed, 20 insertions, 1 deletions
diff --git a/roles/nameservers/tasks/main.yml b/roles/nameservers/tasks/main.yml
index 7f13ebd..e078c00 100644
--- a/roles/nameservers/tasks/main.yml
+++ b/roles/nameservers/tasks/main.yml
@@ -1,21 +1,40 @@
---
+
+## PRIMARY
+
- name: create named.conf.local for primary
template:
src: ../templates/named.conf.local.primary.j2
dest: /etc/bind/named.conf.local
+ owner: bind
+ group: bind
when: inventory_hostname in groups['dnsprimary']
+- name: create /etc/bind/zones if not exist
+ ansible.builtin.file:
+ path: /etc/bind/zones
+ state: directory
+ owner: bind
+ group: bind
+
- name: create primary zone files for primary
template:
src: "../templates/{{ item.zone_file }}.j2"
- dest: "/etc/bind/{{ item.zone_file }}"
+ dest: "/etc/bind/zones/{{ item.zone_file }}"
+ owner: bind
+ group: bind
with_items: "{{ dns_zones }}"
when: inventory_hostname in groups['dnsprimary']
+
+## REPLICA
+
- name: create named.conf.local for replica
template:
src: ../templates/named.conf.local.replica.j2
dest: /etc/bind/named.conf.local
+ owner: bind
+ group: bind
when: inventory_hostname in groups['dnsreplica']
- name: restart bind9