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

Fix for delegate_to with hosts that aren't in inventory

This commit is contained in:
Toshio Kuratomi 2014-12-05 12:35:43 -08:00
parent 3b80f63e22
commit b042fcc349

View file

@ -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')