[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fab-user] fabric as library, access pool of connections indexed by host
From: |
Jon Mansey |
Subject: |
[Fab-user] fabric as library, access pool of connections indexed by host |
Date: |
Fri, 21 Mar 2014 16:07:10 -0700 |
Hello, my application requries opening ssh connections to a list of hosts
(typically less than 10), then performing different commands on each and
parsing the output. So I need a way to programatically address the ssh commands
sent to the correct host. eg execute command x on host y. However I dont want
to open a new connection and log in each time a command is needed, I want it to
log in when first needed and keep the session open for future use.
it seems fabric's execute command should be able to do this but perhaps im just
missing that there is a far simpler way of making an ssh class that can be
called with a command and an index for host?
so id like to do something like this
env.hosts = [host1, host2, host3]
execute(command1, host1)
execute(commandm, hostn)
Am I on the right track here? Are there any code examples available for this
use-case?
Thanks
Jon
- [Fab-user] fabric as library, access pool of connections indexed by host,
Jon Mansey <=