Commit b042fcc3 by Toshio Kuratomi

Fix for delegate_to with hosts that aren't in inventory

parent 3b80f63e
...@@ -1227,7 +1227,7 @@ class Runner(object): ...@@ -1227,7 +1227,7 @@ class Runner(object):
def _remote_checksum(self, conn, tmp, path, inject): def _remote_checksum(self, conn, tmp, path, inject):
''' takes a remote checksum and returns 1 if no file ''' ''' takes a remote checksum and returns 1 if no file '''
if 'delegate_to' in inject and inject['delegate_to']: if 'delegate_to' in inject and inject['delegate_to'] and inject['delegate_to'] in inject['hostvars']:
python_interp = inject['hostvars'][inject['delegate_to']].get('ansible_python_interpreter', 'python') python_interp = inject['hostvars'][inject['delegate_to']].get('ansible_python_interpreter', 'python')
else: else:
python_interp = inject['hostvars'][inject['inventory_hostname']].get('ansible_python_interpreter', 'python') python_interp = inject['hostvars'][inject['inventory_hostname']].get('ansible_python_interpreter', 'python')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment