Sha256: 4017b1354a15ceb3b0210ddff8dd0fc9e35cfea07cfd0a4060a3f980182ffc47

Contents?: true

Size: 1.32 KB

Versions: 17

Compression:

Stored size: 1.32 KB

Contents

+ List of all datacenters
-------------------------
<% datacenters.  each do |dc| %>
  * <%= dc %> with <%= services(dc:dc).keys.count %> services, <%= nodes(dc:dc).count %> nodes
<% end %>

===========

+ List of all services in current DC
------------------------------------
<% services.each do |service_name, tags|
 %>  * <%= service_name %> [ <%= tags %> ]
<% end %>

===========

+ List all services instances with http tag on current DC, instances sorted by node name
----------------------------------------------------------------------------------------
<% services.each do |service_name, tags|
     if tags.include? 'http'
%>  ++ Service <%= service_name %>
<%     service(service_name, tag:'http').sort {|a,b| a['Node']['Node'] <=> b['Node']['Node'] }.each do |snode|
%>  * <%= service_name %> -> <%=
  snode['Node']['Node'] %>:<%= snode['Service']['Port'] %>  <%=
  snode['Service']['Tags'] %> status: <%
  snode['Checks'].each do |c| %> <%= c['Status']
  %><% end if snode['Checks'] %>
<%     end
     end
   end %>

===========

+ List all nodes for DC, sorted by name
---------------------------------------
<% nodes.sort {|a,b| a['Node'] <=> b['Node'] }.each do |snode|
%>  * <%= snode['Address'].ljust(16) %> <%= snode['Node'] %>
<% end %>

+ KV of Current DC
------------------

<% kv(keys:true).each do |key|
%> * <%= key %>
<% end %>

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
consul-templaterb-1.3.1 samples/consul_template.txt.erb
consul-templaterb-1.3.0 samples/consul_template.txt.erb
consul-templaterb-1.2.1 samples/consul_template.txt.erb
consul-templaterb-1.2.0 samples/consul_template.txt.erb
consul-templaterb-1.1.3 samples/consul_template.txt.erb
consul-templaterb-1.1.2 samples/consul_template.txt.erb
consul-templaterb-1.1.1 samples/consul_template.txt.erb
consul-templaterb-1.1.0 samples/consul_template.txt.erb
consul-templaterb-1.0.11 samples/consul_template.txt.erb
consul-templaterb-1.0.10 samples/consul_template.txt.erb
consul-templaterb-1.0.9 samples/consul_template.txt.erb
consul-templaterb-1.0.8 samples/consul_template.txt.erb
consul-templaterb-1.0.7 samples/consul_template.txt.erb
consul-templaterb-1.0.6 samples/consul_template.txt.erb
consul-templaterb-1.0.5 samples/consul_template.txt.erb
consul-templaterb-1.0.4 samples/consul_template.txt.erb
consul-templaterb-1.0.3 samples/consul_template.txt.erb