Browse Source

fix inventory plugin

master
Jörg Thalheim 7 years ago
parent
commit
baaee38387
  1. 5
      inventory/lxc.rb

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