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
7254b22b
Commit
7254b22b
authored
Jul 22, 2015
by
Andrew Hamilton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing delegate_to when using a variable
parent
d412bc72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
lib/ansible/executor/task_executor.py
+9
-9
No files found.
lib/ansible/executor/task_executor.py
View file @
7254b22b
...
@@ -455,19 +455,19 @@ class TaskExecutor:
...
@@ -455,19 +455,19 @@ class TaskExecutor:
# get the vars for the delegate by its name
# get the vars for the delegate by its name
try
:
try
:
this_info
=
variables
[
'hostvars'
][
self
.
_task
.
delegate_to
]
this_info
=
variables
[
'hostvars'
][
self
.
_task
.
delegate_to
]
# get the real ssh_address for the delegate and allow ansible_ssh_host to be templated
#self._play_context.remote_user = self._compute_delegate_user(self.delegate_to, delegate['inject'])
self
.
_play_context
.
remote_addr
=
this_info
.
get
(
'ansible_ssh_host'
,
self
.
_task
.
delegate_to
)
self
.
_play_context
.
port
=
this_info
.
get
(
'ansible_ssh_port'
,
self
.
_play_context
.
port
)
self
.
_play_context
.
password
=
this_info
.
get
(
'ansible_ssh_pass'
,
self
.
_play_context
.
password
)
self
.
_play_context
.
private_key_file
=
this_info
.
get
(
'ansible_ssh_private_key_file'
,
self
.
_play_context
.
private_key_file
)
self
.
_play_context
.
connection
=
this_info
.
get
(
'ansible_connection'
,
C
.
DEFAULT_TRANSPORT
)
self
.
_play_context
.
become_pass
=
this_info
.
get
(
'ansible_sudo_pass'
,
self
.
_play_context
.
become_pass
)
except
:
except
:
# make sure the inject is empty for non-inventory hosts
# make sure the inject is empty for non-inventory hosts
this_info
=
{}
this_info
=
{}
# get the real ssh_address for the delegate and allow ansible_ssh_host to be templated
#self._play_context.remote_user = self._compute_delegate_user(self.delegate_to, delegate['inject'])
self
.
_play_context
.
remote_addr
=
this_info
.
get
(
'ansible_ssh_host'
,
self
.
_task
.
delegate_to
)
self
.
_play_context
.
port
=
this_info
.
get
(
'ansible_ssh_port'
,
self
.
_play_context
.
port
)
self
.
_play_context
.
password
=
this_info
.
get
(
'ansible_ssh_pass'
,
self
.
_play_context
.
password
)
self
.
_play_context
.
private_key_file
=
this_info
.
get
(
'ansible_ssh_private_key_file'
,
self
.
_play_context
.
private_key_file
)
self
.
_play_context
.
connection
=
this_info
.
get
(
'ansible_connection'
,
C
.
DEFAULT_TRANSPORT
)
self
.
_play_context
.
become_pass
=
this_info
.
get
(
'ansible_sudo_pass'
,
self
.
_play_context
.
become_pass
)
if
self
.
_play_context
.
remote_addr
in
(
'127.0.0.1'
,
'localhost'
):
if
self
.
_play_context
.
remote_addr
in
(
'127.0.0.1'
,
'localhost'
):
self
.
_play_context
.
connection
=
'local'
self
.
_play_context
.
connection
=
'local'
...
...
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