1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

KeyError: 'delegate_to' no more

This commit is contained in:
Skylar Saveland 2013-11-17 21:26:17 -08:00
parent b7971a426c
commit 7bc64581d7

View file

@ -36,14 +36,14 @@ class ActionModule(object):
def setup(self, module_name, inject): def setup(self, module_name, inject):
''' Always default to localhost as delegate if None defined ''' ''' Always default to localhost as delegate if None defined '''
if inject['delegate_to'] is None: if inject.get('delegate_to') is None:
inject['delegate_to'] = '127.0.0.1' inject['delegate_to'] = '127.0.0.1'
inject['ansible_connection'] = 'local' inject['ansible_connection'] = 'local'
# If sudo is active, disable from the connection set self.sudo to True. # If sudo is active, disable from the connection set self.sudo to True.
if self.runner.sudo: if self.runner.sudo:
self.runner.sudo = False self.runner.sudo = False
def run(self, conn, tmp, module_name, module_args, def run(self, conn, tmp, module_name, module_args,
inject, complex_args=None, **kwargs): inject, complex_args=None, **kwargs):
''' generates params and passes them on to the rsync module ''' ''' generates params and passes them on to the rsync module '''