mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Runner index re-write for clarity.
This commit is contained in:
parent
2a6ee163f0
commit
9e56b16ab2
@ -2,27 +2,24 @@
|
|||||||
Salt Runners
|
Salt Runners
|
||||||
============
|
============
|
||||||
|
|
||||||
.. seealso:: :ref:`The full list of runners <all-salt.runners>`
|
|
||||||
|
|
||||||
Salt runners are convenience applications executed with the salt-run command.
|
Salt runners are convenience applications executed with the salt-run command.
|
||||||
|
|
||||||
Salt runners work similar to salt modules however they execute on the
|
Salt runners work similarly to Salt execution modules however they execute on the
|
||||||
Salt master itself instead of each individual Salt minion.
|
Salt master itself instead of remote Salt minions.
|
||||||
|
|
||||||
A Salt runner can be a simple client call, or a complex application.
|
A Salt runner can be a simple client call or a complex application.
|
||||||
|
|
||||||
The use for a Salt runner is to build a frontend hook for running sets of
|
.. seealso:: :ref:`The full list of runners <all-salt.runners>`
|
||||||
commands via Salt or creating special formatted output.
|
|
||||||
|
|
||||||
Writing Salt Runners
|
Writing Salt Runners
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
A Salt runner is written very similar to a Salt module. Both are Python
|
A Salt runner is written in a similar manner to a Salt execution module.
|
||||||
modules which contain functions and each public function is a runner
|
Both are Python modules which contain functions and each public function
|
||||||
which may be executed via the *salt-run* command.
|
is a runner which may be executed via the *salt-run* command.
|
||||||
|
|
||||||
For example, if a Python module named test.py is created in the runners
|
For example, if a Python module named ``test.py`` is created in the runners
|
||||||
directory and contains a function called ``foo``, the runner could be
|
directory and contains a function called ``foo``, the ``test`` runner could be
|
||||||
invoked with the following command:
|
invoked with the following command:
|
||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
@ -32,12 +29,12 @@ invoked with the following command:
|
|||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
The best examples of runners can be found in the Salt source:
|
Examples of runners can be found in the Salt distribution:
|
||||||
|
|
||||||
:blob:`salt/runners`
|
:blob:`salt/runners`
|
||||||
|
|
||||||
A simple runner that returns a well-formatted list of the minions that are
|
A simple runner that returns a well-formatted list of the minions that are
|
||||||
responding to Salt calls would look like this:
|
responding to Salt calls could look like this:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user