From 5b26b6bf880c2da16f61b7dd427cb3b7b705fe6c Mon Sep 17 00:00:00 2001 From: Martin Geno Date: Sun, 19 Jun 2016 00:00:18 +0200 Subject: [PATCH] fix ansible output --- models/ansible.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/ansible.go b/models/ansible.go index 19255ea..8dd6bcd 100644 --- a/models/ansible.go +++ b/models/ansible.go @@ -3,7 +3,7 @@ package models type Ansible struct { Nodes []string `json:"nodes"` Meta struct { - HostVars []*AnsibleHostVars `json:"hostvars"` + HostVars map[string]*AnsibleHostVars `json:"hostvars"` } `json:"_meta"` } type AnsibleHostVars struct { @@ -40,7 +40,7 @@ func GenerateAnsible(nodes *Nodes, aliases map[string]*Alias) *Ansible { vars.GeoLatitude = alias.Location.Latitude vars.GeoLongitude = alias.Location.Longtitude } - ansible.Meta.HostVars = append(ansible.Meta.HostVars, vars) + ansible.Meta.HostVars[nodeid] = vars } }