Nodegroups are declared using a compound target specification. The compound target documentation can be found here.
The nodegroups master config file parameter is used to define nodegroups. Here's an example nodegroup configuration within /etc/salt/master:
nodegroups:
group1: 'L@foo.domain.com,bar.domain.com,baz.domain.com or bl*.domain.com'
group2: 'G@os:Debian and foo.domain.com'
Note
The 'L' within group1 is matching a list of minions, while the 'G' in group2 is matching specific grains. See the compound matchers documentation for more details.
To match a nodegroup on the CLI, use the -N command-line option:
salt -N group1 test.ping
To match in your top file, make sure to put - match: nodegroup on the line directly following the nodegroup name.
base:
group1:
- match: nodegroup
- webserver
Current Salt release: 2014.1.6
Docs for previous releases on salt.rtfd.org.