SwitchTower allows you to easily deploy your Rails applications to your server farms.
I have only started playing with it recently, but found quite a nice use for it which is not Rails related: security patches.
Now, if you have just one system to update, it's not too much of a bother. As the number of systems you administer increases, so does the time it takes to apply security patches.
Using SwitchTower means that I don't have to write a separate script to update servers, which would probably involve expect. SwitchTower will only ask for your password once, then it applies that password throughout the task.
Here's how I did it.
I created a Rails application:
$ rails linux_servers
Created the default switchtower files:
$ switchtower -A ./linux_servers LinuxServers
Now I just edited deploy.rb to include:
role :dev, *%w(dev1 dev2 dev3)
role :test, *%w(test1 test2 test3)
role :live, *%w(live1 live2 live3)
desc "Update servers"
task :update_servers, :roles => [:dev, :test, :live] do
sudo "apt-get update"
sudo "apt-get -y upgrade"
end
To execute:
$ rake remote_exec ACTION=update_servers
And that's just saved me minutes of tedium every time I have to patch servers. Yay!