|
|
@ -157,16 +157,22 @@ class Connection(ansible.plugins.connection.ConnectionBase):
|
|
|
|
Parent Context of the sudo Context. For Ansible, this should always
|
|
|
|
Parent Context of the sudo Context. For Ansible, this should always
|
|
|
|
be a Context returned by _connect_ssh().
|
|
|
|
be a Context returned by _connect_ssh().
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
return mitogen.service.call(self.parent, ContextService.handle, cast({
|
|
|
|
return mitogen.service.call(
|
|
|
|
'method': 'sudo',
|
|
|
|
self.parent,
|
|
|
|
'username': self._play_context.become_user,
|
|
|
|
ContextService.handle,
|
|
|
|
'password': self._play_context.password,
|
|
|
|
cast({
|
|
|
|
'python_path': python_path or self.python_path,
|
|
|
|
'method': 'sudo',
|
|
|
|
'sudo_path': self.sudo_path,
|
|
|
|
'username': self._play_context.become_user,
|
|
|
|
'via': via,
|
|
|
|
'password': self._play_context.password,
|
|
|
|
'sudo_args': shlex.split(self._play_context.sudo_flags or
|
|
|
|
'python_path': python_path or self.python_path,
|
|
|
|
self._play_context.become_flags or ''),
|
|
|
|
'sudo_path': self.sudo_path,
|
|
|
|
}))
|
|
|
|
'via': via,
|
|
|
|
|
|
|
|
'sudo_args': shlex.split(
|
|
|
|
|
|
|
|
self._play_context.sudo_flags or
|
|
|
|
|
|
|
|
self._play_context.become_flags or ''
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
def _connect(self):
|
|
|
|
def _connect(self):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|