getting consul hostname using consul-template

975 views
Skip to first unread message

arindam choudhury

unread,
Feb 22, 2016, 11:18:15 AM2/22/16
to Consul
Hi,

I am using consul DNS. I am using a custom domain "arindamdomain.com".

So "agent1" becomes "agent1.node.dc1.arindamdomain.com".

Is there any way I can get it using consul-template?

Best Regards,
Arindam Choudhury

James Phillips

unread,
Mar 9, 2016, 8:16:07 PM3/9/16
to consu...@googlegroups.com
Hi Arindam,

There's a node function you can use to query nodes using consul-template - https://github.com/hashicorp/consul-template#node.

That's not super common though, usually you define services running on each node and you do queries around services - https://github.com/hashicorp/consul-template#service. The intro guide is a good place to learn about services - https://www.consul.io/intro/getting-started/install.html, and there's a DNS-specific guide here that might be useful if you are mixing Consul DNS with other services for your custom domain - https://www.consul.io/docs/guides/forwarding.html.

Hope that helps!

-- James

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/consul/issues
IRC: #consul on Freenode
---
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/3bc49e74-6b06-4e46-a048-d9a1984f46d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages