fix inventory plugin
This commit is contained in:
parent
b620ff03e1
commit
baaee38387
@ -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…
Reference in New Issue
Block a user