host_by_group: scope in cluster

This commit is contained in:
Mikaël Cluseau 2023-05-15 15:54:16 +02:00
parent 74abbf9eda
commit 482d3c83ba

View File

@ -52,7 +52,7 @@ func clusterFuncs(clusterSpec *clustersconfig.Cluster) map[string]interface{} {
"hosts_by_group": func(group string) (hosts []interface{}) { "hosts_by_group": func(group string) (hosts []interface{}) {
for _, host := range src.Hosts { for _, host := range src.Hosts {
if host.Group == group { if host.Cluster == cluster && host.Group == group {
hosts = append(hosts, asMap(host)) hosts = append(hosts, asMap(host))
} }
} }