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
bac35ae7
Commit
bac35ae7
authored
Jun 14, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set correct become mehotds for plugin
fixed mixup with remote password vs become_password
parent
ff443d45
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
lib/ansible/plugins/connections/ssh.py
+6
-6
No files found.
lib/ansible/plugins/connections/ssh.py
View file @
bac35ae7
...
@@ -40,6 +40,8 @@ from ansible.plugins.connections import ConnectionBase
...
@@ -40,6 +40,8 @@ from ansible.plugins.connections import ConnectionBase
class
Connection
(
ConnectionBase
):
class
Connection
(
ConnectionBase
):
''' ssh based connections '''
''' ssh based connections '''
become_methods
=
frozenset
(
C
.
BECOME_METHODS
)
.
difference
([
'runas'
])
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
# SSH connection specific init stuff
# SSH connection specific init stuff
self
.
_common_args
=
[]
self
.
_common_args
=
[]
...
@@ -261,7 +263,7 @@ class Connection(ConnectionBase):
...
@@ -261,7 +263,7 @@ class Connection(ConnectionBase):
def
exec_command
(
self
,
cmd
,
tmp_path
,
executable
=
'/bin/sh'
,
in_data
=
None
,
sudoable
=
True
):
def
exec_command
(
self
,
cmd
,
tmp_path
,
executable
=
'/bin/sh'
,
in_data
=
None
,
sudoable
=
True
):
''' run a command on the remote host '''
''' run a command on the remote host '''
super
(
Connection
,
self
)
.
exec_command
(
cmd
,
tmp_path
,
executable
=
executable
,
in_data
=
in_data
,
sudoable
=
Fals
e
)
super
(
Connection
,
self
)
.
exec_command
(
cmd
,
tmp_path
,
executable
=
executable
,
in_data
=
in_data
,
sudoable
=
sudoabl
e
)
host
=
self
.
_connection_info
.
remote_addr
host
=
self
.
_connection_info
.
remote_addr
...
@@ -303,13 +305,11 @@ class Connection(ConnectionBase):
...
@@ -303,13 +305,11 @@ class Connection(ConnectionBase):
# create process
# create process
(
p
,
stdin
)
=
self
.
_run
(
ssh_cmd
,
in_data
)
(
p
,
stdin
)
=
self
.
_run
(
ssh_cmd
,
in_data
)
if
prompt
:
self
.
_send_password
()
self
.
_send_password
()
no_prompt_out
=
''
no_prompt_out
=
''
no_prompt_err
=
''
no_prompt_err
=
''
q
(
self
.
_connection_info
.
password
)
if
self
.
_connection_info
.
become
and
sudoable
and
self
.
_connection_info
.
become_pass
:
if
self
.
_connection_info
.
become
and
sudoable
and
self
.
_connection_info
.
password
:
# several cases are handled for sudo privileges with password
# several cases are handled for sudo privileges with password
# * NOPASSWD (tty & no-tty): detect success_key on stdout
# * NOPASSWD (tty & no-tty): detect success_key on stdout
# * without NOPASSWD:
# * without NOPASSWD:
...
@@ -349,7 +349,7 @@ class Connection(ConnectionBase):
...
@@ -349,7 +349,7 @@ class Connection(ConnectionBase):
if
not
self
.
_connection_info
.
check_become_success
(
become_output
,
success_key
):
if
not
self
.
_connection_info
.
check_become_success
(
become_output
,
success_key
):
if
sudoable
:
if
sudoable
:
stdin
.
write
(
self
.
_connection_info
.
password
+
'
\n
'
)
stdin
.
write
(
self
.
_connection_info
.
become_pass
+
'
\n
'
)
else
:
else
:
no_prompt_out
+=
become_output
no_prompt_out
+=
become_output
no_prompt_err
+=
become_errput
no_prompt_err
+=
become_errput
...
...
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