These special groups were not handled properly.
{{if .InGroup "detected_freebsd"}}
This is FreeBSD host
{{end}}
+
+{{if .InGroup "all"}}
+all
+{{end}}
+{{if .InGroup "host1.example.org"}}
+host1.example.org
+{{end}}
+{{if .InGroup "host2"}}
+host2
+{{end}}
+{{if .InGroup "host3.example.net"}}
+host3.example.net
+{{end}}
`),
},
"/etc/rc.local": {
{{if .InGroup "detected_freebsd"}}
This is FreeBSD host
{{end}}
+
+{{if .InGroup "all"}}
+all
+{{end}}
+{{if .InGroup "host1.example.org"}}
+host1.example.org
+{{end}}
+{{if .InGroup "host2"}}
+host2
+{{end}}
+{{if .InGroup "host3.example.net"}}
+host3.example.net
+{{end}}
`),
},
"/etc/rc.local": {
func (t *templateArgs) InGroup(group string) bool {
// Don't permit invalid groups to detect typos; detected groups cannot
// be checked
- if !t.allGroups[group] &&
+ if group != GroupAll &&
+ !t.allGroups[group] &&
+ !t.allHosts[group] &&
!strings.HasPrefix(group, GroupDetectedPrefix) {
panic(fmt.Sprintf("group %q does not exist", group))
}
This is GNU/Linux host
+
+
+all
+
+
+host1.example.org
+
+
+
`),
},
"/etc/rc.local": {
{{if .InGroup "detected_freebsd"}}
This is FreeBSD host
{{end}}
+
+{{if .InGroup "all"}}
+all
+{{end}}
+{{if .InGroup "host1.example.org"}}
+host1.example.org
+{{end}}
+{{if .InGroup "host2"}}
+host2
+{{end}}
+{{if .InGroup "host3.example.net"}}
+host3.example.net
+{{end}}
`),
},
"/etc/rc.local": {
Mode: 0644,
Uid: -1,
Gid: -1,
- Data: []byte("Welcome to Host ONE\n\n\n\n"),
+ Data: []byte("Welcome to Host ONE\n\n\n\n\n\nall\n\n\nhost1.example.org\n\n\n\n"),
},
"/etc/rc.local": &safcm.File{
OrigGroup: "group",
Mode: 0644,
Uid: -1,
Gid: -1,
- Data: []byte("Welcome to Host ONE\n\n\n\n"),
+ Data: []byte("Welcome to Host ONE\n\n\n\n\n\nall\n\n\nhost1.example.org\n\n\n\n"),
},
"/etc/rc.local": &safcm.File{
OrigGroup: "group",
{{if .InGroup "detected_freebsd"}}
This is FreeBSD host
{{end}}
+
+{{if .InGroup "all"}}
+all
+{{end}}
+{{if .InGroup "host1.example.org"}}
+host1.example.org
+{{end}}
+{{if .InGroup "host2"}}
+host2
+{{end}}
+{{if .InGroup "host3.example.net"}}
+host3.example.net
+{{end}}