From 0d5d5f2bf66b5e7519269a454ccc3c4b3196d91c Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 6 Apr 2017 21:32:18 -0400 Subject: [PATCH] correctly get all hosts in 'all' --- lib/ansible/inventory/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/inventory/__init__.py b/lib/ansible/inventory/__init__.py index 6cc5a9dbba5..de5fe4c72fc 100644 --- a/lib/ansible/inventory/__init__.py +++ b/lib/ansible/inventory/__init__.py @@ -161,6 +161,7 @@ class Inventory(object): ### POST PROCESS groups and hosts after specific parser was invoked + hosts = [] group_names = set() # set group vars from group_vars/ files and vars plugins for g in self.groups: @@ -168,10 +169,11 @@ class Inventory(object): group.vars = combine_vars(group.vars, self.get_group_variables(group.name)) self.get_group_vars(group) group_names.add(group.name) + hosts.extend(group.get_hosts()) host_names = set() # get host vars from host_vars/ files and vars plugins - for host in self.get_hosts(ignore_limits=True, ignore_restrictions=True): + for host in hosts: host.vars = combine_vars(host.vars, self.get_host_variables(host.name)) self.get_host_vars(host) host_names.add(host.name)