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
2d88246c
Commit
2d88246c
authored
Feb 07, 2014
by
Richard Isaacson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5885 from risaacson/issue5739_4
Addresses #5739 and cleans up copy.py
parents
4636a0d1
ac0a5c8a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
lib/ansible/runner/__init__.py
+14
-3
lib/ansible/runner/action_plugins/copy.py
+0
-0
No files found.
lib/ansible/runner/__init__.py
View file @
2d88246c
...
...
@@ -373,7 +373,7 @@ class Runner(object):
# *****************************************************
def
_execute_module
(
self
,
conn
,
tmp
,
module_name
,
args
,
async_jid
=
None
,
async_module
=
None
,
async_limit
=
None
,
inject
=
None
,
persist_files
=
False
,
complex_args
=
None
):
async_jid
=
None
,
async_module
=
None
,
async_limit
=
None
,
inject
=
None
,
persist_files
=
False
,
complex_args
=
None
,
delete_remote_tmp
=
True
):
''' transfer and run a module along with its arguments on the remote side'''
...
...
@@ -459,7 +459,7 @@ class Runner(object):
cmd
=
" "
.
join
([
environment_string
.
strip
(),
shebang
.
replace
(
"#!"
,
""
)
.
strip
(),
cmd
])
cmd
=
cmd
.
strip
()
if
tmp
.
find
(
"tmp"
)
!=
-
1
and
not
C
.
DEFAULT_KEEP_REMOTE_FILES
and
not
persist_files
:
if
tmp
.
find
(
"tmp"
)
!=
-
1
and
not
C
.
DEFAULT_KEEP_REMOTE_FILES
and
not
persist_files
and
delete_remote_tmp
:
if
not
self
.
sudo
or
self
.
su
or
self
.
sudo_user
==
'root'
or
self
.
su_user
==
'root'
:
# not sudoing or sudoing to root, so can cleanup files in the same step
cmd
=
cmd
+
"; rm -rf
%
s >/dev/null 2>&1"
%
tmp
...
...
@@ -475,7 +475,7 @@ class Runner(object):
else
:
res
=
self
.
_low_level_exec_command
(
conn
,
cmd
,
tmp
,
sudoable
=
sudoable
,
in_data
=
in_data
)
if
tmp
.
find
(
"tmp"
)
!=
-
1
and
not
C
.
DEFAULT_KEEP_REMOTE_FILES
and
not
persist_files
:
if
tmp
.
find
(
"tmp"
)
!=
-
1
and
not
C
.
DEFAULT_KEEP_REMOTE_FILES
and
not
persist_files
and
delete_remote_tmp
:
if
(
self
.
sudo
or
self
.
su
)
and
(
self
.
sudo_user
!=
'root'
or
self
.
su_user
!=
'root'
):
# not sudoing to root, so maybe can't delete files as that other user
# have to clean up temp files as original user in a second step
...
...
@@ -1011,6 +1011,17 @@ class Runner(object):
# *****************************************************
def
_remove_tmp_path
(
self
,
conn
,
tmp_path
):
''' Remove a tmp_path. '''
if
"-tmp-"
in
tmp_path
:
cmd
=
"rm -rf
%
s >/dev/null 2>&1"
%
tmp_path
self
.
_low_level_exec_command
(
conn
,
cmd
,
None
,
sudoable
=
False
)
# If we have gotten here we have a working ssh configuration.
# If ssh breaks we could leave tmp directories out on the remote system.
# *****************************************************
def
_copy_module
(
self
,
conn
,
tmp
,
module_name
,
module_args
,
inject
,
complex_args
=
None
):
''' transfer a module over SFTP, does not run it '''
(
...
...
lib/ansible/runner/action_plugins/copy.py
View file @
2d88246c
This diff is collapsed.
Click to expand it.
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