From 04868c22b79fa30d3046f66ab26167d3d8d98c37 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Sat, 15 Jul 2017 00:19:55 -0400 Subject: [PATCH] fixed issue with null host vars --- lib/ansible/plugins/inventory/yaml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/inventory/yaml.py b/lib/ansible/plugins/inventory/yaml.py index 612e5174bb0..3934c2167f3 100644 --- a/lib/ansible/plugins/inventory/yaml.py +++ b/lib/ansible/plugins/inventory/yaml.py @@ -138,7 +138,7 @@ class InventoryModule(BaseFileInventoryPlugin): if 'hosts' in group_data: for host_pattern in group_data['hosts']: hosts, port = self._parse_host(host_pattern) - self.populate_host_vars(hosts, group_data['hosts'][host_pattern], group, port) + self.populate_host_vars(hosts, group_data['hosts'][host_pattern] or {}, group, port) else: self.display.warning("Skipping '%s' as this is not a valid group name" % group)