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
37b91c7b
Commit
37b91c7b
authored
Oct 17, 2012
by
Daniel Hokka Zakrisson
Committed by
Michael DeHaan
Oct 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ansible_ssh_host after
339c05bb
parent
6ce84416
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
lib/ansible/runner/__init__.py
+9
-16
No files found.
lib/ansible/runner/__init__.py
View file @
37b91c7b
...
...
@@ -382,31 +382,24 @@ class Runner(object):
conn
=
None
actual_host
=
host
actual_port
=
port
try
:
alternative_host
=
inject
.
get
(
'ansible_ssh_host'
,
None
)
if
alternative_host
is
not
None
:
actual_host
=
alternative_host
delegate_to
=
inject
.
get
(
'delegate_to'
,
None
)
# the delegated host may have different SSH port configured, etc
# and we need to transfer those, and only those, variables
if
delegate_to
is
not
None
:
delegate_to
=
utils
.
template
(
self
.
basedir
,
delegate_to
,
inject
)
delegate_vars
=
{}
try
:
delegate_vars
=
inject
[
'hostvars'
][
delegate_to
]
for
(
k
,
v
)
in
delegate_vars
.
iteritems
():
if
k
.
startswith
(
'ansible_ssh_'
):
inject
[
k
]
=
v
except
errors
.
AnsibleError
:
# host not listed in inventory, it's ok
pass
# the host record may just be an alias in case of tunnels
alternative_host
=
inject
.
get
(
'ansible_ssh_host'
,
None
)
if
delegate_to
is
not
None
and
not
alternative_host
:
actual_host
=
delegate_to
delegate_to
=
utils
.
template
(
self
.
basedir
,
delegate_to
,
inject
)
actual_host
=
inject
[
'hostvars'
][
delegate_to
]
.
get
(
'ansible_ssh_host'
,
delegate_to
)
actual_port
=
inject
[
'hostvars'
][
delegate_to
]
.
get
(
'ansible_ssh_port'
,
port
)
# connect
conn
=
self
.
connector
.
connect
(
actual_host
,
port
)
conn
=
self
.
connector
.
connect
(
actual_host
,
actual_
port
)
if
delegate_to
is
not
None
or
alternative_host
is
not
None
:
conn
.
_delegate_for
=
host
...
...
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