O'Reilly logo

Salt Cookbook by Anirban Saha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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...

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

How it works... ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required