salt stack: grains vs pillars

Jeff Bauer picture Jeff Bauer · Oct 29, 2012 · Viewed 17.2k times · Source

In the Salt system there are grains and pillars. I understand how I can assign custom grains, but when would it be better to consider using pillars?

Answer

Jeff Bauer picture Jeff Bauer · Oct 29, 2012

In Salt, grains are used for immutable aspects of your minion, such as the cpu, memory, location, time zone, etc.

A pillar is a list of data on the master (in SLS format) that you need to distribute to your minions. Pillar allows you to set variables that the minions can access, for example a database configuration option.