Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
1864a480
Commit
1864a480
authored
May 09, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not read user's SSH config file because only reading it partially is confusing to everyone :)
parent
d19588b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
21 deletions
+1
-21
lib/ansible/connection.py
+1
-21
No files found.
lib/ansible/connection.py
View file @
1864a480
...
@@ -76,27 +76,7 @@ class ParamikoConnection(object):
...
@@ -76,27 +76,7 @@ class ParamikoConnection(object):
self
.
port
=
self
.
runner
.
remote_port
self
.
port
=
self
.
runner
.
remote_port
def
_get_conn
(
self
):
def
_get_conn
(
self
):
credentials
=
{}
user
=
self
.
runner
.
remote_user
user
=
self
.
runner
.
remote_user
keypair
=
None
# Read file ~/.ssh/config, get data hostname, keyfile, port, etc
# This will *NOT* overrides the ansible username and hostname " , getting the port and keyfile only.
try
:
ssh_config
=
paramiko
.
SSHConfig
()
config_file
=
(
'~/.ssh/config'
)
if
os
.
path
.
exists
(
os
.
path
.
expanduser
(
config_file
)):
ssh_config
.
parse
(
open
(
os
.
path
.
expanduser
(
config_file
)))
credentials
=
ssh_config
.
lookup
(
self
.
host
)
except
IOError
,
e
:
raise
errors
.
AnsibleConnectionFailed
(
str
(
e
))
if
'port'
in
credentials
:
self
.
port
=
int
(
credentials
[
'port'
])
if
'identityfile'
in
credentials
:
keypair
=
os
.
path
.
expanduser
(
credentials
[
'identityfile'
])
ssh
=
paramiko
.
SSHClient
()
ssh
=
paramiko
.
SSHClient
()
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
ssh
.
set_missing_host_key_policy
(
paramiko
.
AutoAddPolicy
())
...
@@ -108,7 +88,7 @@ class ParamikoConnection(object):
...
@@ -108,7 +88,7 @@ class ParamikoConnection(object):
allow_agent
=
True
,
allow_agent
=
True
,
look_for_keys
=
True
,
look_for_keys
=
True
,
password
=
self
.
runner
.
remote_pass
,
password
=
self
.
runner
.
remote_pass
,
key_filename
=
keypair
,
# key_filename=None, # TODO: allow this to be passed in
timeout
=
self
.
runner
.
timeout
,
timeout
=
self
.
runner
.
timeout
,
port
=
self
.
port
port
=
self
.
port
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment