Skip to content

Commit

Permalink
ignore missing inventory for mixed groups and hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed May 2, 2023
1 parent ef21c42 commit ebb4dd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func (p *PlayBook) targetHosts(name string) ([]Destination, error) {
}
if len(t.Groups) > 0 {
// target is group, get hosts from inventory
if p.inventory == nil {
if p.inventory == nil && len(t.Hosts) == 0 { // if inventory is not loaded and target has no hosts, return error
return nil, fmt.Errorf("inventory is not loaded")
}
for _, g := range t.Groups {
Expand Down

0 comments on commit ebb4dd7

Please sign in to comment.