fix ansible output
This commit is contained in:
parent
1b68531e7a
commit
5b26b6bf88
@ -3,7 +3,7 @@ package models
|
|||||||
type Ansible struct {
|
type Ansible struct {
|
||||||
Nodes []string `json:"nodes"`
|
Nodes []string `json:"nodes"`
|
||||||
Meta struct {
|
Meta struct {
|
||||||
HostVars []*AnsibleHostVars `json:"hostvars"`
|
HostVars map[string]*AnsibleHostVars `json:"hostvars"`
|
||||||
} `json:"_meta"`
|
} `json:"_meta"`
|
||||||
}
|
}
|
||||||
type AnsibleHostVars struct {
|
type AnsibleHostVars struct {
|
||||||
@ -40,7 +40,7 @@ func GenerateAnsible(nodes *Nodes, aliases map[string]*Alias) *Ansible {
|
|||||||
vars.GeoLatitude = alias.Location.Latitude
|
vars.GeoLatitude = alias.Location.Latitude
|
||||||
vars.GeoLongitude = alias.Location.Longtitude
|
vars.GeoLongitude = alias.Location.Longtitude
|
||||||
}
|
}
|
||||||
ansible.Meta.HostVars = append(ansible.Meta.HostVars, vars)
|
ansible.Meta.HostVars[nodeid] = vars
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user