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
18cb155b
Commit
18cb155b
authored
Jul 14, 2013
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now ANSIBLE_KEEP_REMOTE_FILE acts as boolean
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
parent
81940c8b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
lib/ansible/constants.py
+1
-1
lib/ansible/runner/__init__.py
+2
-2
lib/ansible/runner/action_plugins/script.py
+1
-1
No files found.
lib/ansible/constants.py
View file @
18cb155b
...
...
@@ -108,7 +108,7 @@ DEFAULT_TRANSPORT = get_config(p, DEFAULTS, 'transport', 'ANSIBLE
DEFAULT_SCP_IF_SSH
=
get_config
(
p
,
'ssh_connection'
,
'scp_if_ssh'
,
'ANSIBLE_SCP_IF_SSH'
,
False
,
boolean
=
True
)
DEFAULT_MANAGED_STR
=
get_config
(
p
,
DEFAULTS
,
'ansible_managed'
,
None
,
'Ansible managed: {file} modified on
%
Y-
%
m-
%
d
%
H:
%
M:
%
S by {uid} on {host}'
)
DEFAULT_SYSLOG_FACILITY
=
get_config
(
p
,
DEFAULTS
,
'syslog_facility'
,
'ANSIBLE_SYSLOG_FACILITY'
,
'LOG_USER'
)
DEFAULT_KEEP_REMOTE_FILES
=
get_config
(
p
,
DEFAULTS
,
'keep_remote_files'
,
'ANSIBLE_KEEP_REMOTE_FILES'
,
'0'
)
DEFAULT_KEEP_REMOTE_FILES
=
get_config
(
p
,
DEFAULTS
,
'keep_remote_files'
,
'ANSIBLE_KEEP_REMOTE_FILES'
,
False
,
boolean
=
True
)
DEFAULT_SUDO
=
get_config
(
p
,
DEFAULTS
,
'sudo'
,
'ANSIBLE_SUDO'
,
False
,
boolean
=
True
)
DEFAULT_SUDO_EXE
=
get_config
(
p
,
DEFAULTS
,
'sudo_exe'
,
'ANSIBLE_SUDO_EXE'
,
'sudo'
)
DEFAULT_SUDO_FLAGS
=
get_config
(
p
,
DEFAULTS
,
'sudo_flags'
,
'ANSIBLE_SUDO_FLAGS'
,
'-H'
)
...
...
lib/ansible/runner/__init__.py
View file @
18cb155b
...
...
@@ -329,7 +329,7 @@ class Runner(object):
cmd
=
" "
.
join
([
environment_string
.
strip
(),
shebang
.
replace
(
"#!"
,
""
)
.
strip
(),
cmd
])
cmd
=
cmd
.
strip
()
if
tmp
.
find
(
"tmp"
)
!=
-
1
and
C
.
DEFAULT_KEEP_REMOTE_FILES
!=
'1'
and
not
persist_files
:
if
tmp
.
find
(
"tmp"
)
!=
-
1
and
not
C
.
DEFAULT_KEEP_REMOTE_FILES
and
not
persist_files
:
if
not
self
.
sudo
or
self
.
sudo_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
...
...
@@ -338,7 +338,7 @@ class Runner(object):
if
self
.
sudo
and
self
.
sudo_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
if
tmp
.
find
(
"tmp"
)
!=
-
1
and
C
.
DEFAULT_KEEP_REMOTE_FILES
!=
'1'
and
not
persist_files
:
if
tmp
.
find
(
"tmp"
)
!=
-
1
and
not
C
.
DEFAULT_KEEP_REMOTE_FILES
and
not
persist_files
:
cmd2
=
"rm -rf
%
s >/dev/null 2>&1"
%
tmp
self
.
_low_level_exec_command
(
conn
,
cmd2
,
tmp
,
sudoable
=
False
)
...
...
lib/ansible/runner/action_plugins/script.py
View file @
18cb155b
...
...
@@ -68,7 +68,7 @@ class ActionModule(object):
result
=
handler
.
run
(
conn
,
tmp
,
'raw'
,
module_args
,
inject
)
# clean up after
if
tmp
.
find
(
"tmp"
)
!=
-
1
and
C
.
DEFAULT_KEEP_REMOTE_FILES
!=
'1'
:
if
tmp
.
find
(
"tmp"
)
!=
-
1
and
not
C
.
DEFAULT_KEEP_REMOTE_FILES
:
self
.
runner
.
_low_level_exec_command
(
conn
,
'rm -rf
%
s >/dev/null 2>&1'
%
tmp
,
tmp
)
return
result
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