Merge pull request #4937 from skyl/synchronize-keyerror

KeyError: 'delegate_to' lookup in sync module needs to be checked to see if defined for ad hoc
This commit is contained in:
Michael DeHaan 2013-11-18 11:40:27 -08:00
commit f18acee779

View file

@ -36,7 +36,7 @@ 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.