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
2a8d1f07
Commit
2a8d1f07
authored
Jun 13, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mktemp-vanish' of
https://github.com/dagwieers/ansible
into devel
Conflicts: lib/ansible/runner/__init__.py
parents
7926ab5b
b3b22c41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
lib/ansible/runner/__init__.py
+11
-11
No files found.
lib/ansible/runner/__init__.py
View file @
2a8d1f07
...
...
@@ -663,7 +663,7 @@ class Runner(object):
module_name
=
utils
.
template
(
self
.
module_name
,
inject
,
self
.
setup_cache
)
tmp
=
self
.
_
get
_tmp_path
(
conn
)
tmp
=
self
.
_
make
_tmp_path
(
conn
)
result
=
None
if
self
.
module_name
==
'copy'
:
...
...
@@ -717,21 +717,21 @@ class Runner(object):
# *****************************************************
def
_
get
_tmp_path
(
self
,
conn
):
'''
gets
a temporary path on a remote box '''
def
_
make
_tmp_path
(
self
,
conn
):
'''
make and return
a temporary path on a remote box '''
basetmp
=
C
.
DEFAULT_REMOTE_TMP
basefile
=
'ansible-
%
s-
%
s'
%
(
time
.
time
(),
random
.
randint
(
0
,
2
**
48
))
basetmp
=
os
.
path
.
join
(
C
.
DEFAULT_REMOTE_TMP
,
basefile
)
if
self
.
remote_user
==
'root'
:
basetmp
=
"/var/tmp"
cmd
=
"mktemp -d
%
s/ansible.XXXXXX"
%
basetmp
basetmp
=
os
.
path
.
join
(
'/var/tmp'
,
basefile
)
cmd
=
'mkdir -p
%
s'
%
basetmp
if
self
.
remote_user
!=
'root'
:
cmd
=
"mkdir -p
%
s &&
%
s"
%
(
basetmp
,
cmd
)
cmd
+=
' && chmod a+x
%
s'
%
basetmp
cmd
+=
' && echo
%
s'
%
basetmp
result
=
self
.
_low_level_exec_command
(
conn
,
cmd
,
None
,
sudoable
=
False
)
cleaned
=
result
.
split
(
"
\n
"
)[
0
]
.
strip
()
+
'/'
if
self
.
remote_user
!=
'root'
:
cmd
=
'chmod a+x
%
s'
%
cleaned
self
.
_low_level_exec_command
(
conn
,
cmd
,
None
,
sudoable
=
False
)
return
cleaned
...
...
@@ -751,7 +751,7 @@ class Runner(object):
else
:
raise
errors
.
AnsibleFileNotFound
(
"module
%
s not found in
%
s"
%
(
module
,
self
.
module_path
))
out_path
=
tmp
+
module
out_path
=
os
.
path
.
join
(
tmp
,
module
)
# use the correct python interpreter for the host
host_variables
=
self
.
inventory
.
get_variables
(
conn
.
host
)
...
...
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