1
0

index.rst 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. .. _engines:
  2. ============
  3. Salt Engines
  4. ============
  5. .. versionadded:: 2015.8.0
  6. Salt Engines are long-running, external system processes that leverage Salt.
  7. - Engines have access to Salt configuration, execution modules, and runners (``__opts__``, ``__salt__``, and ``__runners__``).
  8. - Engines are executed in a separate process that is monitored by Salt. If a Salt engine stops, it is restarted automatically.
  9. - Engines can run on the Salt master and on Salt minions.
  10. Salt engines enhance and replace the :ref:`external processes <ext-processes>` functionality.
  11. Configuration
  12. =============
  13. Salt engines are configured under an ``engines`` top-level section in your Salt master or Salt minion configuration. Provide a list of engines and parameters under this section.
  14. .. code-block:: yaml
  15. engines:
  16. - logstash:
  17. host: log.my_network.com
  18. port: 5959
  19. proto: tcp
  20. Salt engines must be in the Salt path, or you can add the ``engines_dirs`` option in your Salt master configuration with a list of directories under which Salt attempts to find Salt engines. This option should be formatted as a list of directories to search, such as:
  21. .. code-block:: yaml
  22. engines_dirs:
  23. - /home/bob/engines
  24. Writing an Engine
  25. =================
  26. An example Salt engine, :blob:`salt/engines/test.py`, is available in the Salt source. To develop an engine, the only requirement is that your module implement the ``start()`` function.