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
88e2595a
Commit
88e2595a
authored
Jan 27, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing bug relating to su without an su_pass
parent
fac7c6d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
lib/ansible/playbook/__init__.py
+4
-1
lib/ansible/runner/__init__.py
+5
-4
No files found.
lib/ansible/playbook/__init__.py
View file @
88e2595a
...
@@ -488,8 +488,11 @@ class PlayBook(object):
...
@@ -488,8 +488,11 @@ class PlayBook(object):
callbacks
=
self
.
runner_callbacks
,
callbacks
=
self
.
runner_callbacks
,
sudo
=
play
.
sudo
,
sudo
=
play
.
sudo
,
sudo_user
=
play
.
sudo_user
,
sudo_user
=
play
.
sudo_user
,
transport
=
play
.
transport
,
sudo_pass
=
self
.
sudo_pass
,
sudo_pass
=
self
.
sudo_pass
,
su
=
play
.
su
,
su_user
=
play
.
su_user
,
su_pass
=
self
.
su_pass
,
transport
=
play
.
transport
,
is_playbook
=
True
,
is_playbook
=
True
,
module_vars
=
play
.
vars
,
module_vars
=
play
.
vars
,
default_vars
=
play
.
default_vars
,
default_vars
=
play
.
default_vars
,
...
...
lib/ansible/runner/__init__.py
View file @
88e2595a
...
@@ -393,7 +393,7 @@ class Runner(object):
...
@@ -393,7 +393,7 @@ class Runner(object):
sudoable
=
False
sudoable
=
False
if
self
.
su
:
if
self
.
su
:
res
=
self
.
_low_level_exec_command
(
conn
,
cmd
,
tmp
,
su
=
sudoabl
e
,
in_data
=
in_data
)
res
=
self
.
_low_level_exec_command
(
conn
,
cmd
,
tmp
,
su
=
Tru
e
,
in_data
=
in_data
)
else
:
else
:
res
=
self
.
_low_level_exec_command
(
conn
,
cmd
,
tmp
,
sudoable
=
sudoable
,
in_data
=
in_data
)
res
=
self
.
_low_level_exec_command
(
conn
,
cmd
,
tmp
,
sudoable
=
sudoable
,
in_data
=
in_data
)
...
@@ -631,7 +631,8 @@ class Runner(object):
...
@@ -631,7 +631,8 @@ class Runner(object):
actual_transport
=
inject
.
get
(
'ansible_connection'
,
self
.
transport
)
actual_transport
=
inject
.
get
(
'ansible_connection'
,
self
.
transport
)
actual_private_key_file
=
inject
.
get
(
'ansible_ssh_private_key_file'
,
self
.
private_key_file
)
actual_private_key_file
=
inject
.
get
(
'ansible_ssh_private_key_file'
,
self
.
private_key_file
)
self
.
sudo_pass
=
inject
.
get
(
'ansible_sudo_pass'
,
self
.
sudo_pass
)
self
.
sudo_pass
=
inject
.
get
(
'ansible_sudo_pass'
,
self
.
sudo_pass
)
self
.
su
=
inject
.
get
(
'ansible_su'
,
self
.
su_pass
)
self
.
su
=
inject
.
get
(
'ansible_su'
,
self
.
su
)
self
.
su_user
=
inject
.
get
(
'ansible_su_user'
,
self
.
su_user
)
self
.
su_pass
=
inject
.
get
(
'ansible_su_pass'
,
self
.
su_pass
)
self
.
su_pass
=
inject
.
get
(
'ansible_su_pass'
,
self
.
su_pass
)
if
actual_private_key_file
is
not
None
:
if
actual_private_key_file
is
not
None
:
...
@@ -843,7 +844,7 @@ class Runner(object):
...
@@ -843,7 +844,7 @@ class Runner(object):
sudo_user
=
self
.
sudo_user
sudo_user
=
self
.
sudo_user
su_user
=
self
.
su_user
su_user
=
self
.
su_user
# compare connection user to
sudo
_user and disable if the same
# compare connection user to
(su|sudo)
_user and disable if the same
if
hasattr
(
conn
,
'user'
):
if
hasattr
(
conn
,
'user'
):
if
conn
.
user
==
sudo_user
or
conn
.
user
==
su_user
:
if
conn
.
user
==
sudo_user
or
conn
.
user
==
su_user
:
sudoable
=
False
sudoable
=
False
...
@@ -852,8 +853,8 @@ class Runner(object):
...
@@ -852,8 +853,8 @@ class Runner(object):
if
su
:
if
su
:
rc
,
stdin
,
stdout
,
stderr
=
conn
.
exec_command
(
cmd
,
rc
,
stdin
,
stdout
,
stderr
=
conn
.
exec_command
(
cmd
,
tmp
,
tmp
,
su_user
=
su_user
,
su
=
su
,
su
=
su
,
su_user
=
su_user
,
executable
=
executable
,
executable
=
executable
,
in_data
=
in_data
)
in_data
=
in_data
)
else
:
else
:
...
...
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