mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #37028 from damon-atkins/update_topics_grains_doco
Update topics/grains doco, about considerations before adding a Grain
This commit is contained in:
commit
104a153a1f
1 changed files with 9 additions and 0 deletions
|
@ -132,6 +132,15 @@ Using Jinja templating, only one match entry needs to be defined.
|
|||
Writing Grains
|
||||
==============
|
||||
|
||||
Consider adding grains when the information is needed for targeting within
|
||||
top.sls or salt cli. The grains should only contain the **bare minimum data**
|
||||
required for targeting. The "name" and "data structure" of the grain should be
|
||||
design to support many platforms, operating systems or applications. Most of the
|
||||
time an "execution module" called from within Jinja template will provide the
|
||||
necessary detail information for a Salt State. Consider if the idea for a grain
|
||||
should be developed as a execution module rather than a grain or a combination
|
||||
of both keeping minimum data within the grain.
|
||||
|
||||
The grains interface is derived by executing
|
||||
all of the "public" functions found in the modules located in the grains
|
||||
package or the custom grains directory. The functions in the modules of
|
||||
|
|
Loading…
Add table
Reference in a new issue