From a327420b6716ad3c85c3f11024beb360101389d0 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 12 Feb 2016 00:49:25 -0500 Subject: [PATCH] properly combine vars if merge is set hash_behaviour = merge now also applies to include vars --- lib/ansible/vars/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ansible/vars/__init__.py b/lib/ansible/vars/__init__.py index 4135ff1768..9cb0108ed6 100644 --- a/lib/ansible/vars/__init__.py +++ b/lib/ansible/vars/__init__.py @@ -600,8 +600,10 @@ class VariableManager: ''' Sets a value in the vars_cache for a host. ''' - host_name = host.get_name() if host_name not in self._vars_cache: self._vars_cache[host_name] = dict() - self._vars_cache[host_name][varname] = value + if varname in self._vars_cache[host_name]: + self._vars_cache[host_name][varname] = combine_vars(self._vars_cache[host_name][varname], value) + else: + self._vars_cache[host_name][varname] = value