fabric/fabric — Issue #574: use_ssh_config for a Role with multiple Hosts with same HostName but different port only updates one Host
Author: damzam
Created: 2012-03-07 00:33:12+00:00
State: open

I have two hosts for a given role:

They have the same IP Address, but they're actually mapped to different boxes based on the port #.

ROLEDEFS = {
'abc-loadtest': ['root@sci-loadtest-int1','root@sci-loadtest-int2'],
}

env.roledefs.update(ROLEDEFS)

"""
from .ssh/config....

Host abc-loadtest-int1
HostName 70.24.106.5
port 30607
HostKeyAlias abc-loadtest1
Host abc-loadtest-int2
HostName 70.24.106.5
port 30609
HostKeyAlias abc-loadtest2

""""

When I run sudo, local, put for the Role, I get output lines from each host. But it turns out that the code is really just running on one of the machines.

When the tasks are finished running, I only see the message for closing the connection to the first host: 70.24.106.5:30607.

Maybe there's an issue with HostConnectionCache only retaining one mapping for multiple hosts with the same IP but different port?