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.
Edit the
/etc/salt/master
file on the Salt master and uncomment the keynodegroups
. Edit the lines following thenodegroups
key 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'
Restart the
salt-master
daemon for the changes to take place.