fix: all组显示所有主机 + playbook warn模块改为debug
This commit is contained in:
@@ -275,6 +275,12 @@ func (s *AnsibleService) ListGroups() []models.HostGroup {
|
||||
// 动态展开组内主机(通过 host.Groups 字段关联,而非 group.Hosts)
|
||||
var hostList []models.Host
|
||||
for _, h := range s.hosts {
|
||||
if gcopy.Name == "all" {
|
||||
// all 组包含所有主机
|
||||
hcopy := *h
|
||||
hostList = append(hostList, hcopy)
|
||||
continue
|
||||
}
|
||||
for _, hGroup := range h.Groups {
|
||||
if hGroup == gcopy.Name {
|
||||
hcopy := *h
|
||||
@@ -282,7 +288,7 @@ func (s *AnsibleService) ListGroups() []models.HostGroup {
|
||||
break
|
||||
}
|
||||
}
|
||||
// 也检查主机的默认组(all/ungrouped)
|
||||
// 也检查主机的默认组(ungrouped)
|
||||
if len(h.Groups) == 0 && gcopy.Name == "ungrouped" {
|
||||
hcopy := *h
|
||||
hostList = append(hostList, hcopy)
|
||||
|
||||
Verwijs in nieuw issue
Block a user