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
919db102
Commit
919db102
authored
Mar 08, 2015
by
Chris Church
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9601 from cchurch/set_delegate_before_connect
Set delegate on connection plugin before calling connect()
parents
876383f6
de2746ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
lib/ansible/runner/__init__.py
+4
-2
lib/ansible/runner/connection.py
+2
-1
No files found.
lib/ansible/runner/__init__.py
View file @
919db102
...
...
@@ -963,9 +963,11 @@ class Runner(object):
return
ReturnData
(
host
=
host
,
comm_ok
=
False
,
result
=
result
)
try
:
conn
=
self
.
connector
.
connect
(
actual_host
,
actual_port
,
actual_user
,
actual_pass
,
actual_transport
,
actual_private_key_file
)
if
self
.
delegate_to
or
host
!=
actual_host
:
conn
.
delegate
=
host
delegate_host
=
host
else
:
delegate_host
=
None
conn
=
self
.
connector
.
connect
(
actual_host
,
actual_port
,
actual_user
,
actual_pass
,
actual_transport
,
actual_private_key_file
,
delegate_host
)
default_shell
=
getattr
(
conn
,
'default_shell'
,
''
)
shell_type
=
inject
.
get
(
'ansible_shell_type'
)
...
...
lib/ansible/runner/connection.py
View file @
919db102
...
...
@@ -31,10 +31,11 @@ class Connector(object):
def
__init__
(
self
,
runner
):
self
.
runner
=
runner
def
connect
(
self
,
host
,
port
,
user
,
password
,
transport
,
private_key_file
):
def
connect
(
self
,
host
,
port
,
user
,
password
,
transport
,
private_key_file
,
delegate_host
):
conn
=
utils
.
plugins
.
connection_loader
.
get
(
transport
,
self
.
runner
,
host
,
port
,
user
=
user
,
password
=
password
,
private_key_file
=
private_key_file
)
if
conn
is
None
:
raise
AnsibleError
(
"unsupported connection type:
%
s"
%
transport
)
conn
.
delegate
=
delegate_host
if
private_key_file
:
# If private key is readable by user other than owner, flag an error
st
=
None
...
...
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