diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-01-02 15:42:42 -0500 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-01-02 15:42:42 -0500 |
commit | c6a770bd1a6cab43ec4282043bf4f5d6e175c19c (patch) | |
tree | a478467aeeb1d3ab47c07cdbacaa7f0a58f1f584 /roles/nameservers | |
parent | 1f9f2b7608d3915d2f8a3a556db19c27040d3a4d (diff) | |
download | oldinfra-c6a770bd1a6cab43ec4282043bf4f5d6e175c19c.tar.gz oldinfra-c6a770bd1a6cab43ec4282043bf4f5d6e175c19c.zip |
initial headscale foo & dns updates
Diffstat (limited to 'roles/nameservers')
-rw-r--r-- | roles/nameservers/tasks/main.yml | 8 | ||||
-rw-r--r-- | roles/nameservers/templates/db.simponic.xyz.j2 | 23 | ||||
-rw-r--r-- | roles/nameservers/templates/named.conf.local.primary.j2 | 4 | ||||
-rw-r--r-- | roles/nameservers/templates/named.conf.local.replica.j2 | 4 |
4 files changed, 25 insertions, 14 deletions
diff --git a/roles/nameservers/tasks/main.yml b/roles/nameservers/tasks/main.yml index e078c00..d52a3b0 100644 --- a/roles/nameservers/tasks/main.yml +++ b/roles/nameservers/tasks/main.yml @@ -19,8 +19,8 @@ - name: create primary zone files for primary template: - src: "../templates/{{ item.zone_file }}.j2" - dest: "/etc/bind/zones/{{ item.zone_file }}" + src: "../templates/db.{{ item.zone }}.j2" + dest: "/etc/bind/zones/db.{{ item.zone }}" owner: bind group: bind with_items: "{{ dns_zones }}" @@ -37,6 +37,10 @@ group: bind when: inventory_hostname in groups['dnsreplica'] +- name: flush dns cache on replicas + file: path={{ item }} state=absent + with_fileglob: /var/cache/bind/db.* + - name: restart bind9 service: name: bind9 diff --git a/roles/nameservers/templates/db.simponic.xyz.j2 b/roles/nameservers/templates/db.simponic.xyz.j2 index d219beb..13b58c2 100644 --- a/roles/nameservers/templates/db.simponic.xyz.j2 +++ b/roles/nameservers/templates/db.simponic.xyz.j2 @@ -1,6 +1,6 @@ $TTL 604800 @ IN SOA {{ dns_primary_hostname }}.simponic.xyz. admin.simponic.xyz. ( - 1704161086 ; Serial + {{ ansible_date_time.epoch }} ; Serial 86400 ; Refresh 86400 ; Retry 2419200 ; Expire @@ -11,27 +11,34 @@ $TTL 604800 simponic.xyz. IN NS {{ dns_primary_hostname }}.simponic.xyz. simponic.xyz. IN NS {{ dns_replica_hostname }}.simponic.xyz. -; A records for name servers +;; A Records +;; ryo {{ dns_primary_hostname }} IN A {{ dns_primary_ip }} +;; nijika {{ dns_replica_hostname }} IN A {{ dns_replica_ip }} -;; A Records mail.simponic.xyz. 1 IN A 192.3.248.205 -simponic.xyz. 1 IN A 129.123.76.14 +johan.simponic.xyz. 1 IN A 23.95.20.192 +osaka.simponic.xyz. 1 IN A 129.123.76.14 + +levi.simponic.xyz. 1 IN A 23.95.214.176 +simponic.xyz. 1 IN A 23.95.214.176 ;; CNAME Records -s1._domainkey.simponic.xyz. 1 IN CNAME s1.domainkey.u25709709.wl210.sendgrid.net. -s2._domainkey.simponic.xyz. 1 IN CNAME s2.domainkey.u25709709.wl210.sendgrid.net. +ash.simponic.xyz. 1 IN CNAME mail.simponic.xyz. static.simponic.xyz. 1 IN CNAME simponic.xyz. www.simponic.xyz. 1 IN CNAME simponic.xyz. +s1._domainkey.simponic.xyz. 1 IN CNAME s1.domainkey.u25709709.wl210.sendgrid.net. +s2._domainkey.simponic.xyz. 1 IN CNAME s2.domainkey.u25709709.wl210.sendgrid.net. ;; MX Records simponic.xyz. 1 IN MX 10 mail.simponic.xyz. ;; TXT Records +dkim._domainkey.simponic.xyz. 1 IN TXT "v=DKIM1; p= MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoNWLcbrcGq0z8f0fSmxLbfK/Q/ZwmnPyJEfljS2VuDIm7DUXahHIFtB8hfZ/WAocoirb8kUHTvTAgmUOXPpNxTDve3tV9S+CBBYHH2c9XBsuaZn/Vi0TR5vbBDuISmlXT6k+2cdq0LO+PYRwJI65t/JWTR5fQlCmVgxbI5gwDYFRZC0Nl5gEwuKw7pdEJg4Pymyox" "i" "zcikaGk/plXj6BDvv9pK1q8Wa+QPIkuBPFvsEh3KSApMP1p5thzHFaeNyCn5PuYEvbgkal0722px6GvYfR2W/APNRztbmWVewXH6kEWCgOYMkmWiYYLgEwz62rq2SzszP1rrl3WjVi26916wIDAQAB" +simponic.xyz. 1 IN TXT "v=spf1 mx ip4:192.3.248.205 ~all" + _acme-challenge.simponic.xyz. 1 IN TXT "6GcrSuBAj8pNKqiCBWUIONRJjbDVtOizadBDGngW4-U" _acme-challenge.simponic.xyz. 1 IN TXT "IErMxNBY3v1Wc3RV06khZXKDC1f9EObYHSXETK5ZKYE" _acme-challenge.simponic.xyz. 1 IN TXT "3jWQSVbU-SdebeymX58bir5kEHG1dVHRXYE-P_4Qao8" _acme-challenge.simponic.xyz. 1 IN TXT "LXaVBwQCanWKF4cNxzPHHPM9N-kkjhn8_4r6RsveBqs" -dkim._domainkey.simponic.xyz. 1 IN TXT "v=DKIM1; p= MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoNWLcbrcGq0z8f0fSmxLbfK/Q/ZwmnPyJEfljS2VuDIm7DUXahHIFtB8hfZ/WAocoirb8kUHTvTAgmUOXPpNxTDve3tV9S+CBBYHH2c9XBsuaZn/Vi0TR5vbBDuISmlXT6k+2cdq0LO+PYRwJI65t/JWTR5fQlCmVgxbI5gwDYFRZC0Nl5gEwuKw7pdEJg4Pymyox" "i" "zcikaGk/plXj6BDvv9pK1q8Wa+QPIkuBPFvsEh3KSApMP1p5thzHFaeNyCn5PuYEvbgkal0722px6GvYfR2W/APNRztbmWVewXH6kEWCgOYMkmWiYYLgEwz62rq2SzszP1rrl3WjVi26916wIDAQAB" -simponic.xyz. 1 IN TXT "v=spf1 mx ip4:192.3.248.205 ~all" diff --git a/roles/nameservers/templates/named.conf.local.primary.j2 b/roles/nameservers/templates/named.conf.local.primary.j2 index 44665e6..18a0532 100644 --- a/roles/nameservers/templates/named.conf.local.primary.j2 +++ b/roles/nameservers/templates/named.conf.local.primary.j2 @@ -1,7 +1,7 @@ {% for zone in dns_zones %} -zone "{{ zone.zone_name }}" { +zone "{{ zone.zone }}" { type master; - file "/etc/bind/zones/{{ zone.zone_file }}"; + file "/etc/bind/zones/db.{{ zone.zone }}"; allow-transfer { {{ dns_replica_ip }}; }; }; {% endfor %} diff --git a/roles/nameservers/templates/named.conf.local.replica.j2 b/roles/nameservers/templates/named.conf.local.replica.j2 index bb14d7d..1313cba 100644 --- a/roles/nameservers/templates/named.conf.local.replica.j2 +++ b/roles/nameservers/templates/named.conf.local.replica.j2 @@ -1,7 +1,7 @@ {% for zone in dns_zones %} -zone "{{ zone.zone_name }}" { +zone "{{ zone.zone }}" { type slave; - file "db.{{ zone.zone_name }}"; + file "db.{{ zone.zone }}"; masters { {{ dns_primary_ip }}; }; }; {% endfor %} |