From a1f09bd89f6daec9365f0654bda6e4e9654be45c Mon Sep 17 00:00:00 2001 From: Serge van Ginderachter Date: Wed, 20 Aug 2014 01:54:15 -0500 Subject: [PATCH] Merge variables for hosts instead of updating in get_variables() --- lib/ansible/inventory/host.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/inventory/host.py b/lib/ansible/inventory/host.py index 1b3c10f9d4e..d4dc20fa462 100644 --- a/lib/ansible/inventory/host.py +++ b/lib/ansible/inventory/host.py @@ -58,7 +58,7 @@ class Host(object): groups = self.get_groups() for group in sorted(groups, key=lambda g: g.depth): results = utils.combine_vars(results, group.get_variables()) - results.update(self.vars) + results = utils.combine_vars(results, self.vars) results['inventory_hostname'] = self.name results['inventory_hostname_short'] = self.name.split('.')[0] results['group_names'] = sorted([ g.name for g in groups if g.name != 'all'])