From 731dbeb7126c0319f47b2a1e72fece21297ab34e Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 17 Jul 2015 23:02:29 -0400 Subject: [PATCH] capture error when smoeone puts a list or some other complex type in delegate_to --- lib/ansible/runner/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index b68928d4bbc..0a98b15b562 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -403,6 +403,9 @@ class Runner(object): # the hostname was not found in the inventory, so # we just ignore this and try the next method pass + except TypeError, e: + # Someone is trying to pass a list or some other 'non string' as a host. + raise errors.AnsibleError("Invalid type for delegate_to: %s" % str(e)) if thisuser is None and self.remote_user: # user defined by play/runner