fix ansible output

This commit is contained in:
Martin Geno 2016-06-19 00:00:18 +02:00
parent 1b68531e7a
commit 5b26b6bf88

View File

@ -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
}
}