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
0f052f2f
Commit
0f052f2f
authored
Aug 08, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_chmod_for_sudo_user' of
https://github.com/willthames/ansible
into devel
parents
d451cc64
414eceb1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
lib/ansible/runner/__init__.py
+8
-5
No files found.
lib/ansible/runner/__init__.py
View file @
0f052f2f
...
...
@@ -210,10 +210,10 @@ class Runner(object):
args
=
utils
.
jsonify
(
args
,
format
=
True
)
(
remote_module_path
,
is_new_style
)
=
self
.
_copy_module
(
conn
,
tmp
,
module_name
,
inject
)
cmd
=
"chmod +x
%
s"
%
remote_module_path
cmd
=
"chmod
u
+x
%
s"
%
remote_module_path
if
self
.
sudo
and
self
.
sudo_user
!=
'root'
:
# deal with possible umask issues once sudo'ed to other user
cmd
=
"chmod
555
%
s"
%
remote_module_path
cmd
=
"chmod
a+rx
%
s"
%
remote_module_path
self
.
_low_level_exec_command
(
conn
,
cmd
,
tmp
)
cmd
=
""
...
...
@@ -266,7 +266,7 @@ class Runner(object):
module_args
+=
" #USE_SHELL"
(
module_path
,
is_new_style
)
=
self
.
_copy_module
(
conn
,
tmp
,
module_name
,
inject
)
self
.
_low_level_exec_command
(
conn
,
"chmod
+
x
%
s"
%
module_path
,
tmp
)
self
.
_low_level_exec_command
(
conn
,
"chmod
a+r
x
%
s"
%
module_path
,
tmp
)
return
self
.
_execute_module
(
conn
,
tmp
,
'async_wrapper'
,
module_args
,
async_module
=
module_path
,
...
...
@@ -315,8 +315,11 @@ class Runner(object):
exec_rc
=
None
if
local_md5
!=
remote_md5
:
# transfer the file to a remote tmp location
tmp_src
=
tmp
+
source
.
split
(
'/'
)[
-
1
]
tmp_src
=
tmp
+
os
.
path
.
basename
(
source
)
conn
.
put_file
(
source
,
tmp_src
)
# fix file permissions when the copy is done as a different user
if
self
.
sudo
and
self
.
sudo_user
:
self
.
_low_level_exec_command
(
conn
,
"chmod a+r
%
s"
%
tmp_src
,
tmp
)
# run the copy module
self
.
module_args
=
"
%
s src=
%
s"
%
(
self
.
module_args
,
tmp_src
)
...
...
@@ -669,7 +672,7 @@ class Runner(object):
cmd
=
'mkdir -p
%
s'
%
basetmp
if
self
.
remote_user
!=
'root'
:
cmd
+=
' && chmod a+x
%
s'
%
basetmp
cmd
+=
' && chmod a+
r
x
%
s'
%
basetmp
cmd
+=
' && echo
%
s'
%
basetmp
result
=
self
.
_low_level_exec_command
(
conn
,
cmd
,
None
,
sudoable
=
False
)
...
...
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