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
e7b5cb87
Commit
e7b5cb87
authored
Aug 05, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix synchronize source path with roles and local connection
Fixes #8261
parent
dd7fa070
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
lib/ansible/plugins/action/synchronize.py
+11
-4
No files found.
lib/ansible/plugins/action/synchronize.py
View file @
e7b5cb87
...
...
@@ -77,7 +77,7 @@ class ActionModule(ActionBase):
del
task_vars
[
key
]
# Add the definitions from localhost
localhost
=
task_vars
[
'hostvars'
][
'
localhost
'
]
localhost
=
task_vars
[
'hostvars'
][
'
127.0.0.1
'
]
if
'ansible_syslog_facility'
in
localhost
:
task_vars
[
'ansible_syslog_facility'
]
=
localhost
[
'ansible_syslog_facility'
]
for
key
in
localhost
:
...
...
@@ -145,12 +145,12 @@ class ActionModule(ActionBase):
self
.
_override_module_replaced_vars
(
task_vars
)
# COMPARE DELEGATE, HOST AND TRANSPORT
process_arg
s
=
False
between_multiple_host
s
=
False
if
dest_host
!=
src_host
and
remote_transport
:
# We're not copying two filesystem trees on the same host so we
# need to correctly format the paths for rsync (like
# user@host:path/to/tree
process_arg
s
=
True
between_multiple_host
s
=
True
# SWITCH SRC AND DEST HOST PER MODE
if
self
.
_task
.
args
.
get
(
'mode'
,
'push'
)
==
'pull'
:
...
...
@@ -159,7 +159,7 @@ class ActionModule(ActionBase):
# MUNGE SRC AND DEST PER REMOTE_HOST INFO
src
=
self
.
_task
.
args
.
get
(
'src'
,
None
)
dest
=
self
.
_task
.
args
.
get
(
'dest'
,
None
)
if
process_arg
s
or
use_delegate
:
if
between_multiple_host
s
or
use_delegate
:
# Private key handling
if
use_delegate
:
private_key
=
task_vars
.
get
(
'ansible_ssh_private_key_file'
)
or
self
.
_play_context
.
private_key_file
...
...
@@ -190,6 +190,13 @@ class ActionModule(ActionBase):
# src is a local path, dest is a remote path: <user>@<host>
src
=
self
.
_process_origin
(
src_host
,
src
,
user
)
dest
=
self
.
_process_remote
(
dest_host
,
dest
,
user
)
else
:
# Still need to munge paths (to account for roles) even if we aren't
# copying files between hosts
if
not
src
.
startswith
(
'/'
):
src
=
self
.
_get_absolute_path
(
path
=
src
)
if
not
dest
.
startswith
(
'/'
):
dest
=
self
.
_get_absolute_path
(
path
=
dest
)
self
.
_task
.
args
[
'src'
]
=
src
self
.
_task
.
args
[
'dest'
]
=
dest
...
...
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