From 5b3e513181d49a4122b2d6600ffe9452a7ce7cf4 Mon Sep 17 00:00:00 2001 From: HACKERMD Date: Mon, 26 Jun 2017 03:58:09 +0200 Subject: [PATCH] Fix bug in dynamic inventory layout --- tmdeploy/inventory.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tmdeploy/inventory.py b/tmdeploy/inventory.py index 8764393..a9befb1 100644 --- a/tmdeploy/inventory.py +++ b/tmdeploy/inventory.py @@ -131,10 +131,11 @@ def build_inventory(setup): if group.name not in inventory: inventory[group.name] = {'hosts': list()} inventory[group.name]['hosts'].append(host_name) + inventory[group.name]['vars'] = dict() if group.vars is not None: - inventory[group.name]['vars'] = group.vars + inventory[group.name]['vars'].update(group.vars) if node_type.vars is not None: - inventory[group.name]['vars'] = node_type.vars + inventory[group.name]['vars'].update(node_type.vars) return inventory