mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
Fix azure inventory to set ['_meta']['hostvars'] instead of just ['meta'].
This commit is contained in:
@@ -100,14 +100,14 @@ class AzureInventory(object):
|
|||||||
if self.args.host:
|
if self.args.host:
|
||||||
data_to_print = self.get_host(self.args.host)
|
data_to_print = self.get_host(self.args.host)
|
||||||
else:
|
else:
|
||||||
# Add the `_meta` information.
|
# Add the `['_meta']['hostvars']` information.
|
||||||
_meta = {}
|
hostvars = {}
|
||||||
if len(data) > 0:
|
if len(data) > 0:
|
||||||
for host in set(reduce(lambda x, y: x + y,
|
for host in set(reduce(lambda x, y: x + y,
|
||||||
[i for i in data.values()])):
|
[i for i in data.values()])):
|
||||||
if host is not None:
|
if host is not None:
|
||||||
_meta[host] = self.get_host(host, jsonify=False)
|
hostvars[host] = self.get_host(host, jsonify=False)
|
||||||
data['_meta'] = _meta
|
data['_meta'] = {'hostvars': hostvars}
|
||||||
|
|
||||||
# JSONify the data.
|
# JSONify the data.
|
||||||
data_to_print = self.json_format_dict(data, pretty=True)
|
data_to_print = self.json_format_dict(data, pretty=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user