I need to be able to locally run a script that will connect to various servers and run commands on them. What is the best way to accomplish this?
|
Personally, I would use Capistrano. It's friendly and written in Ruby and they already did all of the heavy lifting for you. From Wikipedia:
|
|||
|
|
|
you can run a command using
|
|||
|
|
|
I would use ssh with key authentication, I believe ssh has a way to make sure that certain accounts can only log in from certain IP's so I would limit it to that because you might not want to set a passphrase on the keys (you could use a key manager to avoid that but it has limitations too) |
|||||
|
|
What about using configuration management like puppet or chef? This is maybe a little over the top for only one script, but if you need several such scripts it might be worth to consider. |
|||||
|
|
A quickie bash 'for' loop might be easiest, perhaps something like:
Of course, cfengine/puppet/chef/capistrano are better configuration management options. If you wanted to interactively send commands to the various shells, clusterm (http://sourceforge.net/projects/clusterm/) is a solid choice too. |
|||
|
|
|
Puppet and Chef are "pull" systems and I've found that a complementary "push" system implemented using Capistrano, Fabric, or |
|||
|
|
|
I have been pretty happy with a shell script called |
||||
|
|
