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
61e726fe
Commit
61e726fe
authored
Sep 13, 2013
by
Timothy Appnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix to local delegate_to override and proper sudo handling from @smoothify
parent
370784ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
lib/ansible/runner/action_plugins/synchronize.py
+12
-1
No files found.
lib/ansible/runner/action_plugins/synchronize.py
View file @
61e726fe
...
@@ -37,6 +37,11 @@ class ActionModule(object):
...
@@ -37,6 +37,11 @@ class ActionModule(object):
''' Always default to localhost as delegate if None defined '''
''' Always default to localhost as delegate if None defined '''
if
inject
.
get
(
'delegate_to'
)
is
None
:
if
inject
.
get
(
'delegate_to'
)
is
None
:
inject
[
'delegate_to'
]
=
'127.0.0.1'
inject
[
'delegate_to'
]
=
'127.0.0.1'
inject
[
'ansible_connection'
]
=
'local'
# If sudo is active, disable from the connection set self.sudo to True.
if
self
.
runner
.
sudo
:
self
.
runner
.
sudo
=
False
self
.
sudo
=
True
def
run
(
self
,
conn
,
tmp
,
module_name
,
module_args
,
def
run
(
self
,
conn
,
tmp
,
module_name
,
module_args
,
inject
,
complex_args
=
None
,
**
kwargs
):
inject
,
complex_args
=
None
,
**
kwargs
):
...
@@ -76,7 +81,13 @@ class ActionModule(object):
...
@@ -76,7 +81,13 @@ class ActionModule(object):
if
'mode'
in
options
:
if
'mode'
in
options
:
del
options
[
'mode'
]
del
options
[
'mode'
]
# run the synchronize module
rsync_path
=
options
.
get
(
'rsync_path'
,
None
)
if
not
rsync_path
and
self
.
sudo
:
rsync_path
=
'sudo rsync'
# make sure rsync path is quoted.
if
rsync_path
:
options
[
'rsync_path'
]
=
'"'
+
rsync_path
+
'"'
self
.
runner
.
module_args
=
' '
.
join
([
'
%
s=
%
s'
%
(
k
,
v
)
for
(
k
,
self
.
runner
.
module_args
=
' '
.
join
([
'
%
s=
%
s'
%
(
k
,
v
)
for
(
k
,
v
)
in
options
.
items
()])
v
)
in
options
.
items
()])
...
...
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