mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -07:00
ssh_alt.py / decrease # of ssh roundtrips
This commit is contained in:
parent
db182ba498
commit
7f8863f96d
22 changed files with 160 additions and 49 deletions
|
@ -34,15 +34,19 @@ class Connection(object):
|
|||
self.host = host
|
||||
# port is unused, since this is local
|
||||
self.port = port
|
||||
self.has_pipelining = False
|
||||
|
||||
def connect(self, port=None):
|
||||
''' connect to the local host; nothing to do here '''
|
||||
|
||||
return self
|
||||
|
||||
def exec_command(self, cmd, tmp_path, sudo_user, sudoable=False, executable='/bin/sh'):
|
||||
def exec_command(self, cmd, tmp_path, sudo_user, sudoable=False, executable='/bin/sh', in_data=None):
|
||||
''' run a command on the local host '''
|
||||
|
||||
if in_data:
|
||||
raise errors.AnsibleError("Internal Error: this module does not support optimized module pipelining")
|
||||
|
||||
if not self.runner.sudo or not sudoable:
|
||||
if executable:
|
||||
local_cmd = [executable, '-c', cmd]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue