Additional documentation on calling exec modules from templates (#32657)

Refs #32612
This commit is contained in:
Mike Place 2016-04-18 12:16:00 -06:00 committed by Nicole Thomas
parent c910b8dd51
commit 77bea56b68

View file

@ -129,12 +129,24 @@ modules.
The Salt module functions are also made available in the template context as
``salt:``
The following example illustrates calling the ``group_to_gid`` function in the
``file`` execution module with a single positional argument called
``some_group_that_exists``.
.. code-block:: jinja
moe:
user.present:
- gid: {{ salt['file.group_to_gid']('some_group_that_exists') }}
One way to think about this might be that the ``gid`` key is being assigned
a value equivelent to the following python pseudo-code:
.. code-block:: python
import salt.modules.file
file.group_to_gid('some_group_that_exists')
Note that for the above example to work, ``some_group_that_exists`` must exist
before the state file is processed by the templating engine.
@ -145,6 +157,9 @@ MAC address for eth0:
salt['network.hw_addr']('eth0')
To examine the possible arguments to each execution module function,
one can examine the `module reference documentation </ref/modules/all>`:
Advanced SLS module syntax
==========================