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 environments and grains on the minion

In this recipe, we will learn about some advanced minion configurations, such as environments and grains. We will understand how they work and how to configure them on the minion.

How to do it...

Uncomment and edit the /etc/salt/minion file to set the environment parameter:

environment: development

Setting grains in /etc/salt/minion

Uncomment and edit the /etc/salt/minion file to set the grains parameter:

grains:
  environment: development
  location: datacenter1
  server_type: webserver

Setting grains in /etc/salt/grains

Create the file /etc/salt/grains and populate it as follows:

environment: development
location: datacenter1
server_type: webserver

How it works...

The environment parameter in a Salt minion determines ...

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