Understanding pillar_roots
In the early days, pillars didn't exist in Salt. Grains were originally introduced as a mechanism for minions to gather system information. That data was useful to execution modules, and it wasn't long before custom grains were also introduced.
The problem with grains is that they need to be configured directly on minions. While the grains
execution module does allow easy remote editing of those files, it is often easier and more appropriate to configure data for those minions in a centralized location, such as the master.
As you know, pillars are normally stored in the /srv/pillar/
directory on the master, in static YAML files. However, those files don't need to be static.
Templating pillar_roots
By pillar_roots
, we mean the directory that is used as the root directory for pillar files. This setting is configured in the master
configuration file. By default, it is set to the following:
pillar_roots: base: - /srv/pillar/ - /srv/spm/pillar/
The second entry...