From b042fcc349f965a60943a3bfcf25f143b5fff3dc Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Fri, 5 Dec 2014 12:35:43 -0800 Subject: [PATCH] Fix for delegate_to with hosts that aren't in inventory --- lib/ansible/runner/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index b1652d86e34..4f861e50eec 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')