From 2ff2f05a0f542a7798e50db38bc8a8cbe3f1e3a9 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Sat, 2 Mar 2013 10:26:26 +0100 Subject: [PATCH] host.get_variables includes too many variables, use host.vars instead Not quite as attractive, but allows variable precedence and lazy resolution to work as intended, rather than resolving them on a per-inventory basis. --- lib/ansible/inventory/dir.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/inventory/dir.py b/lib/ansible/inventory/dir.py index b92ef4072d7..fc1dc099cc6 100644 --- a/lib/ansible/inventory/dir.py +++ b/lib/ansible/inventory/dir.py @@ -59,7 +59,7 @@ class InventoryDirectory(object): for host in group.get_hosts(): if host.name not in self.hosts: self.hosts[host.name] = Host(host.name) - for k, v in host.get_variables().iteritems(): + for k, v in host.vars.iteritems(): self.hosts[host.name].set_variable(k, v) self.groups[name].add_host(self.hosts[host.name]) # This needs to be a second loop to ensure all the parent groups exist