From e060b060817e72fc0559ea6c8e8e28b98aea191e Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Wed, 9 May 2012 23:26:45 -0400 Subject: [PATCH] Allow hosts not in inventory to override inventory with -i "host1,host2:port" etc, which is the original intent of --override-hosts. --- lib/ansible/inventory.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/inventory.py b/lib/ansible/inventory.py index c796b9c9ef7..09c23bb0fed 100644 --- a/lib/ansible/inventory.py +++ b/lib/ansible/inventory.py @@ -50,6 +50,10 @@ class Inventory(object): # whether the inventory file is a script self._is_script = False + if type(host_list) in [ str, unicode ]: + if host_list.find(",") != -1: + host_list = host_list.split(",") + if type(host_list) == list: all = Group('all') self.groups = [ all ]