Merge pull request #39291 from terminalmage/pillar-docs

Add note about using saltenv jinja var in pillar top files
This commit is contained in:
Mike Place 2017-02-09 14:43:49 -07:00 committed by GitHub
commit 6365211a6f

View file

@ -150,6 +150,24 @@ And the actual pillar file at '/srv/pillar/common_pillar.sls':
foo: bar
boo: baz
.. note::
When working with multiple pillar environments, assuming that each pillar
environment has its own top file, the jinja placeholder ``{{ saltenv }}``
can be used in place of the environment name:
.. code-block:: yaml
{{ saltenv }}:
'*':
- common_pillar
Yes, this is ``{{ saltenv }}``, and not ``{{ pillarenv }}``. The reason for
this is because the Pillar top files are parsed using some of the same code
which parses top files when :ref:`running states <running-highstate>`, so
the pillar environment takes the place of ``{{ saltenv }}`` in the jinja
context.
Pillar Namespace Flattening
===========================