fix inventory plugin

master
Jörg Thalheim 8 years ago
parent b620ff03e1
commit baaee38387
  1. 5
      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)

Loading…
Cancel
Save