A feature that makes Salt very efficient is its ability to configure nodegroups. They are groups of hosts that we can configure based on various system properties and use the group name to target minions. In this recipe, you will learn how to configure nodegroups.
/etc/salt/masterfile on the Salt master and uncomment the key
nodegroups. Edit the lines following the
nodegroupskey so that the entire nodegroups configuration looks as follows:
nodegroups: stgdb: 'G@environment:staging and G@server_type:db' dc1devapp: 'G@location:dc1 and G@environment:development and G@server_type:app' prodmon: 'L@prddc1mon01,prddc2mon03,prddc3mon10'
salt-masterdaemon for the changes to take place.