creating tasks for multiple environments (and gateways)

12 views
Skip to first unread message

Joe Wilcoxson

unread,
Nov 3, 2009, 4:31:12 PM11/3/09
to capis...@googlegroups.com
Hi, I'm looking for a way to manage systems in multiple datacenters/environments, each with their own gateway.

gateway 1 -> app1 app2 app3
gateway 2 -> app1 app2 app3


I get stuck when trying to set "gateway" within the same capfile after its already been set and was looking for a recommendation on how to approach this problem.

example: I can run "cap datacenter1:ifconfig datacenter2:ifconfig" but if i create a 3rd task consisting of these 2 tasks the first gateway is set and is re-used for the second task. "doboth" would yield the interface info for the appservers in datacenter1 twice.

namespace :datacenter1 do
set :gateway, "gateway1"
 task :ifconfig, :roles => [:app] do
  run "ifconfig -a"
 end
end

namespace :datacenter2 do
set :gateway, "gateway2"
 task :ifconfig, :roles => [:app] do
  run "ifconfig -a"
 end
end

task :doboth do
 dnv:ifconfig
 phl:ifconfig
end


Thanks for your time.

-Joe Wilcoxson

Lee Hambley

unread,
Nov 3, 2009, 5:26:46 PM11/3/09
to capis...@googlegroups.com
Joe,

We don't support multiple gateways I'm afraid - you might have to go a level lower, and configure TCP routes and tunnels :( (or, use one gateway (localhost loopback... with tcp routes encapsulated somehow))

-- Lee Hambley

Twitter: @leehambley | @capistranorb
Blog: http://lee.hambley.name/
Working with Rails: http://is.gd/1s5W1


2009/11/3 Joe Wilcoxson <jjwil...@gmail.com>
Reply all
Reply to author
Forward
0 new messages