|
|
@ -81,7 +81,8 @@ class ParamikoConnection(object):
|
|
|
|
keypair = None
|
|
|
|
keypair = None
|
|
|
|
|
|
|
|
|
|
|
|
# Read file ~/.ssh/config, get data hostname, keyfile, port, etc
|
|
|
|
# Read file ~/.ssh/config, get data hostname, keyfile, port, etc
|
|
|
|
# This overrides the ansible defined username,hostname and port
|
|
|
|
# This will *NOT* overrides the ansible username and hostname " , getting the port and keyfile only.
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
ssh_config = paramiko.SSHConfig()
|
|
|
|
ssh_config = paramiko.SSHConfig()
|
|
|
|
config_file = ('~/.ssh/config')
|
|
|
|
config_file = ('~/.ssh/config')
|
|
|
@ -92,12 +93,12 @@ class ParamikoConnection(object):
|
|
|
|
except IOError,e:
|
|
|
|
except IOError,e:
|
|
|
|
raise errors.AnsibleConnectionFailed(str(e))
|
|
|
|
raise errors.AnsibleConnectionFailed(str(e))
|
|
|
|
|
|
|
|
|
|
|
|
if 'hostname' in credentials:
|
|
|
|
#if 'hostname' in credentials:
|
|
|
|
self.host = credentials['hostname']
|
|
|
|
# self.host = credentials['hostname']
|
|
|
|
if 'port' in credentials:
|
|
|
|
if 'port' in credentials:
|
|
|
|
self.port = int(credentials['port'])
|
|
|
|
self.port = int(credentials['port'])
|
|
|
|
if 'user' in credentials:
|
|
|
|
#if 'user' in credentials:
|
|
|
|
user = credentials['user']
|
|
|
|
# user = credentials['user']
|
|
|
|
if 'identityfile' in credentials:
|
|
|
|
if 'identityfile' in credentials:
|
|
|
|
keypair = os.path.expanduser(credentials['identityfile'])
|
|
|
|
keypair = os.path.expanduser(credentials['identityfile'])
|
|
|
|
|
|
|
|
|
|
|
|