Skip to content

Commit

Permalink
Don't rely on Consul for DNS records for each host
Browse files Browse the repository at this point in the history
  • Loading branch information
mjm committed Sep 17, 2021
1 parent fc22971 commit 31a6153
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ $TTL 1m
1w ; Expire
1h ) ; Negative Cache TTL
@ IN NS localhost.
;<< range nodes >>
<< .Node >> IN A << .Address >><< end >>
{% for host, hvars in hostvars.items() %}
{% if host not in groups.jails %}
{{ host }} IN A {{ hvars.default_ip }}
{% endif %}
{% endfor %}
{% for jail in hostvars.artemis.jails %}
{{ jail.name }} IN A {{ jail.ips[0].split("|")[1] }}
{% endfor %}
Expand Down
7 changes: 5 additions & 2 deletions ansible/roles/dns/templates/homelab.local.db.tpl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ $TTL 1m
1w ; Expire
1h ) ; Negative Cache TTL
@ IN NS localhost.
;<< range nodes >>
<< .Node >> IN A << .Address >><< end >>
{% for host, hvars in hostvars.items() %}
{% if host not in groups.jails %}
{{ host }} IN A {{ hvars.default_ip }}
{% endif %}
{% endfor %}
{% for jail in hostvars.artemis.jails %}
{{ jail.name }} IN A {{ jail.ips[0].split("|")[1] }}
{% endfor %}
Expand Down

0 comments on commit 31a6153

Please sign in to comment.