Skip to content

Commit 2cfda98

Browse files
authored
Allow Consul DNS to recurse on haproxy nodes (#488)
PR #486 introduced resolution of hosts for haproxy backends via consul, but did not give it any way to resolve external DNS for the console/pythonanywhere or jobs.pyfound.org/applytojob.com backends. This adds a recursive DNS setup on the haproxy nodes so that they can successfully and fully resolve external services.
1 parent ee75a7a commit 2cfda98

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

pillar/dev/consul.sls

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ consul:
1717
address: www.pythonanywhere.com
1818
service: console
1919
port: 443
20+
- datacenter: vagrant
21+
node: jobspyfound
22+
address: pythonsoftwarefoundation.applytojob.com
23+
service: jobs
24+
port: 443
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recursors": [{% for nameserver in salt['grains.get']('dns:nameservers') %}"{{ nameserver }}"{% if not loop.last %}, {% endif %}{% endfor %}]
3+
}

salt/haproxy/init.sls

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ include:
1515
/etc/nginx/conf.d/default.conf:
1616
file.absent
1717

18+
/etc/consul.d/recursors.json:
19+
file.managed:
20+
- source: salt://haproxy/config/consul-recursors.json
21+
- template: jinja
22+
- user: root
23+
- group: root
24+
- mode: "0644"
25+
- require:
26+
- pkg: consul-pkgs
27+
1828
haproxy:
1929
pkg:
2030
- installed

0 commit comments

Comments
 (0)