Configuring nodegroups
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.
How to do it...
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.
How it works...
In this recipe, we demonstrated how to configure nodegroups in various ways.
The nodegroups
key in the master configuration file needs to be uncommented and all entries under it are identified as configured nodegroups.
The first line is configured...