From 6b1cb22fc31d85a3e9e9bbf315ae959d05623427 Mon Sep 17 00:00:00 2001 From: Serge van Ginderachter Date: Tue, 11 Mar 2014 12:49:54 +0100 Subject: [PATCH] Allow hash_behaviour=merge to be respected in core inventory (For now, this means, enable it also for inventory scripts) --- lib/ansible/inventory/host.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/inventory/host.py b/lib/ansible/inventory/host.py index 19b919ac66d..1b3c10f9d4e 100644 --- a/lib/ansible/inventory/host.py +++ b/lib/ansible/inventory/host.py @@ -16,6 +16,7 @@ # along with Ansible. If not, see . import ansible.constants as C +from ansible import utils class Host(object): ''' a single ansible host ''' @@ -56,7 +57,7 @@ class Host(object): results = {} groups = self.get_groups() for group in sorted(groups, key=lambda g: g.depth): - results.update(group.get_variables()) + results = utils.combine_vars(results, group.get_variables()) results.update(self.vars) results['inventory_hostname'] = self.name results['inventory_hostname_short'] = self.name.split('.')[0]