Open gargantuanprism opened 6 years ago
$ pip freeze | grep -E "(Fabric|para)"
Fabric==1.14.0
paramiko==2.4.0
$ python -V
Python 2.7.12
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
$ cat .ssh/config
host 192.168.10.254
proxycommand ssh steve@192.168.10.221 -W %h:%p
host 192.168.10.25
proxycommand ssh steve@192.168.10.221 -W %h:%p
Do fabric task with '--skip-bad-hosts'
$ fab -H 192.168.10.254,192.168.10.25 -usteve --skip-bad-hosts test1
[192.168.10.254] Executing task 'test1'
[192.168.10.254] run: w
Warning: Timed out trying to connect to 192.168.10.254 (tried 1 time)
Underlying exception:
timed out
[192.168.10.25] Executing task 'test1'
[192.168.10.25] run: w
Warning: Timed out trying to connect to 192.168.10.25 (tried 1 time)
Underlying exception:
timed out
Done.
Do fabric task without '--skip-bad-hosts'
$ fab -H 192.168.10.254,192.168.10.25 -usteve test1
[192.168.10.254] Executing task 'test1'
[192.168.10.254] run: w
Fatal error: Timed out trying to connect to 192.168.10.254 (tried 1 time)
Underlying exception:
timed out
Aborting.
Sorry. It is different from your description. Is there any other information in your problem? And if 'ls-prog-05 is up and ls-prog-06 is down', the port 'localhost:46188' on 'tunnel.xyz' isn't down? @0xANDREW
Python 2.7.12 Fabric 1.14.0 Paramiko 2.4.0 Ubuntu 16.04 LTS
Because of our network topology, I'm generating an SSH config on the fly to use with Fabric. It looks like this:
What I'm doing here is using
tunnel.xyz
as a bastion for some hosts outside our network that open SSH connections to random ports. I was trying to use a more generic solution, but Paramiko was not respecting the%p
parameter in my existing SSH config.Running this command:
fab -H ls-prog-05,ls-prog-06 test
and getting this output:I should note that
ls-prog-05
is up andls-prog-06
is down, andenv.user = 'pi'
.I'd assume proper behavior would be to barf and abort that specific task for
ls-prog-06
, but instead it asks me for a password. It also seems as thoughenv.skip_bad_hosts
doesn't do anything in this situation andenv.abort_on_prompts
aborts the whole session, not just the task(s) for that problematic host.