mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Tweaks on previous refactoring of playbook, version bump a 0.4 reference, remove some debug, etc
This commit is contained in:
@@ -549,6 +549,9 @@ class Runner(object):
|
||||
return ReturnData(host=conn.host, comm_ok=False, result=result)
|
||||
|
||||
|
||||
if self.module_vars is not None:
|
||||
inject.update(self.module_vars)
|
||||
|
||||
source = utils.template(source, inject, self.setup_cache)
|
||||
|
||||
#(host, ok, data, err) = (None, None, None, None)
|
||||
|
||||
@@ -42,15 +42,13 @@ with warnings.catch_warnings():
|
||||
class Connection(object):
|
||||
''' Handles abstract connections to remote hosts '''
|
||||
|
||||
_LOCALHOSTRE = re.compile(r"^(127.0.0.1|localhost|%s)$" % os.uname()[1])
|
||||
|
||||
def __init__(self, runner, transport,sudo_user):
|
||||
self.runner = runner
|
||||
self.transport = transport
|
||||
self.sudo_user = sudo_user
|
||||
def connect(self, host, port=None):
|
||||
conn = None
|
||||
if self.transport == 'local' and self._LOCALHOSTRE.search(host):
|
||||
if self.transport == 'local':
|
||||
conn = LocalConnection(self.runner, host)
|
||||
elif self.transport == 'paramiko':
|
||||
conn = ParamikoConnection(self.runner, host, port)
|
||||
|
||||
Reference in New Issue
Block a user