From baaee38387950bca723038104560b99e577c977e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 15 Nov 2014 14:59:31 +0100 Subject: [PATCH] fix inventory plugin --- inventory/lxc.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inventory/lxc.rb b/inventory/lxc.rb index 1f0d37f..8409de9 100755 --- a/inventory/lxc.rb +++ b/inventory/lxc.rb @@ -11,8 +11,9 @@ json["network"].each do |host, data| hostvars = { ansible_connection: "lxc", ansible_python_interpreter: "/usr/bin/python2" } hostvars.merge!(data["vars"]) if data["vars"] - containers[role] ||= [] - containers[role] << host + containers[role] ||= {} + containers[role]["hosts"] ||= [] + containers[role]["hosts"] << host containers["_meta"]["hostvars"][host] = hostvars end puts JSON.pretty_generate(containers)