Defining these groups had no effect but might confuse the user. As they
don't make any sense forbid them.
"%s conflict with pre-defined group %q",
errPrefix, name)
}
- if hosts.Map[name] != nil {
+ if hosts.Map[name] != nil ||
+ hosts.Map[strings.TrimSuffix(name,
+ GroupRemoveSuffix)] != nil {
return nil, fmt.Errorf(
"%s conflict with existing host",
errPrefix)
nil,
fmt.Errorf("groups.yaml: group \"host2\": conflict with existing host"),
},
+ {
+ "../testdata/group-invalid-conflict-remove",
+ &Config{},
+ hosts,
+ nil,
+ fmt.Errorf("groups.yaml: group \"host2:remove\": conflict with existing host"),
+ },
{
"../testdata/group-invalid-detected",
&Config{},
--- /dev/null
+host2:remove:
+ - host1.example.org