Created
January 8, 2015 14:17
-
-
Save tzz/d1f43436e79748acd3e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundle agent main | |
{ | |
methods: | |
"" usebundle => basic_classes_vars; | |
"" usebundle => basic_classes("ubuntu-server"); | |
# "" usebundle => basic_classes("fellini"); | |
reports: | |
server:: | |
"The server class is set"; | |
workstation:: | |
"The workstation class is set"; | |
} | |
bundle agent basic_classes_vars | |
{ | |
vars: | |
"regex_servers[test]" string => ".*teste.*|.*server.*"; | |
"regex_servers[video]" string => "video\d-.*"; | |
"server_types" slist => getindices("regex_servers"); | |
} | |
bundle agent basic_classes(name) | |
{ | |
classes: | |
"server_$(basic_classes_vars.server_types)" | |
scope => "namespace", | |
expression => regcmp("$(basic_classes_vars.regex_servers[$(basic_classes_vars.server_types)])", "$(name)"); | |
"server" | |
scope => "namespace", | |
expression => regcmp("$(basic_classes_vars.regex_servers[$(basic_classes_vars.server_types)])", $(name)); | |
"workstation" not => "server", | |
scope => "namespace"; | |
reports: | |
workstation:: | |
"$(name) is a WORKSTATION"; | |
server:: | |
"$(name) is a SERVER"; | |
any:: | |
"$(name) is identified as server type: $(basic_classes_vars.server_types)" | |
ifvarclass => "server_$(basic_classes_vars.server_types)"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment