From a54666d31ee54a9b52ef62ce44099d1f887ea7ba Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 14 Jun 2017 16:57:00 -0400 Subject: [PATCH] now host list removes trailing/leading spaces othewise hostnames were just 'fun' --- lib/ansible/plugins/inventory/advanced_host_list.py | 1 + lib/ansible/plugins/inventory/host_list.py | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/ansible/plugins/inventory/advanced_host_list.py b/lib/ansible/plugins/inventory/advanced_host_list.py index 22cc77d67f3..751d210f718 100644 --- a/lib/ansible/plugins/inventory/advanced_host_list.py +++ b/lib/ansible/plugins/inventory/advanced_host_list.py @@ -61,6 +61,7 @@ class InventoryModule(BaseInventoryPlugin): try: for h in host_list.split(','): + h = h.strip() if h: try: (hostnames, port) = self._expand_hostpattern(h) diff --git a/lib/ansible/plugins/inventory/host_list.py b/lib/ansible/plugins/inventory/host_list.py index a690149ce94..f89c9011e8f 100644 --- a/lib/ansible/plugins/inventory/host_list.py +++ b/lib/ansible/plugins/inventory/host_list.py @@ -64,6 +64,7 @@ class InventoryModule(BaseInventoryPlugin): try: for h in host_list.split(','): + h = h.strip() if h: try: (host, port) = parse_address(h, allow_ranges=False)