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
1e7fd219
Commit
1e7fd219
authored
Sep 22, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing synchronize + delegate_to user bug
Fixes #12464
parent
3ffc2783
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
lib/ansible/plugins/action/synchronize.py
+6
-5
No files found.
lib/ansible/plugins/action/synchronize.py
View file @
1e7fd219
...
...
@@ -101,7 +101,7 @@ class ActionModule(ActionBase):
remote_transport
=
True
try
:
delegate_to
=
self
.
_
play_context
.
delegate_to
delegate_to
=
self
.
_
task
.
delegate_to
except
(
AttributeError
,
KeyError
):
delegate_to
=
None
...
...
@@ -115,7 +115,7 @@ class ActionModule(ActionBase):
# ansible's delegate_to mechanism to determine which host rsync is
# running on so localhost could be a non-controller machine if
# delegate_to is used)
src_host
=
'127.0.0.1'
src_host
=
'127.0.0.1'
dest_host
=
task_vars
.
get
(
'ansible_ssh_host'
)
or
task_vars
.
get
(
'inventory_hostname'
)
dest_is_local
=
dest_host
in
C
.
LOCALHOST
...
...
@@ -183,10 +183,11 @@ class ActionModule(ActionBase):
user
=
None
if
boolean
(
self
.
_task
.
args
.
get
(
'set_remote_user'
,
'yes'
)):
if
use_delegate
:
if
'hostvars'
in
task_vars
and
delegate_to
in
task_vars
[
'hostvars'
]:
user
=
task_vars
[
'hostvars'
][
delegate_to
]
.
get
(
'ansible_ssh_user'
,
None
)
user
=
task_vars
.
get
(
'ansible_delegated_vars'
,
dict
())
.
get
(
'ansible_ssh_user'
,
None
)
if
not
user
:
user
=
C
.
DEFAULT_REMOTE_USER
if
not
use_delegate
or
not
user
:
else
:
user
=
task_vars
.
get
(
'ansible_ssh_user'
)
or
self
.
_play_context
.
remote_user
# use the mode to define src and dest's url
...
...
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