Skip to content

Instantly share code, notes, and snippets.

@acqant
Created March 13, 2015 19:04
Show Gist options
  • Save acqant/a65a100d2a361b23d445 to your computer and use it in GitHub Desktop.
Save acqant/a65a100d2a361b23d445 to your computer and use it in GitHub Desktop.
#Get dash box node for ip
dashbox="dash.#{node['medialets']['domain']}"
dash_node=search(:node, "name:#{dashbox}")
#Get mon box node for ip
monbox="mon03.#{node['medialets']['domain']}"
mon_node=search(:node, "name:#{monbox}")
#Get graphite box node for it
graphitebox="graphite.#{node['medialets']['domain']}"
graphite_node=search(:node, "name:#{graphitebox}")
pp dash_node[0]
node.default["stunnel"]["backends"] = { "EC2" => dash_node[0]['ec2']['local_ipv4'] }
template "/usr/local/etc/haproxy/haproxy.cfg" do
source "dash_haproxy.erb"
notifies :restart, "service[haproxy]", :delayed
variables({
:mon_ip => mon_node[0]['ipaddress'],
:graphite_ip => graphite_node[0]['ipaddress'],
})
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment