summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2014-12-05 12:35:43 -0800
committerJames Cammarata <jimi@sngx.net>2015-02-17 13:34:28 -0600
commit3a68c098881b4484f438112c90ce1eb71f2003e7 (patch)
tree8e749eecf3f5e2b89bcf2492025034fadd54a2b6
parentdddfc0b9c55309592b47c00ceff5289b772bd33a (diff)
downloadansible-3a68c098881b4484f438112c90ce1eb71f2003e7.tar.gz
Fix for delegate_to with hosts that aren't in inventory
-rw-r--r--lib/ansible/runner/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py
index b1652d86e3..4f861e50ee 100644
--- a/lib/ansible/runner/__init__.py
+++ b/lib/ansible/runner/__init__.py
@@ -1227,7 +1227,7 @@ class Runner(object):
def _remote_checksum(self, conn, tmp, path, inject):
''' 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')
else:
python_interp = inject['hostvars'][inject['inventory_hostname']].get('ansible_python_interpreter', 'python')