Skip to content

Commit

Permalink
fix: ensure host is enrolled in group before collecting group vars
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhop committed May 14, 2024
1 parent f8e2272 commit d6399a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/inventory/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,9 @@ func (i *Inventory) GetVariablesForSelf() []string {
var tmp, varFiles []string

for _, group := range i.groups {
tmp = append(tmp, i.GetVariablesForGroup(group.String()))
if group.IsHostEnrolled(i.hostname) {
tmp = append(tmp, group.variables)
}
}

tmp = append(tmp, i.GetVariablesForHost(i.hostname))
Expand Down

0 comments on commit d6399a5

Please sign in to comment.