mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Small docfix for the salt runner (#39517)
* Small docfix for the salt runner * Strip trailing whitespace
This commit is contained in:
parent
9d379c0bbf
commit
400d49e1ad
@ -1,11 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
.. versionadded:: 2016.11.0
|
||||
|
||||
This runner makes Salt's
|
||||
execution modules available
|
||||
on the salt master.
|
||||
|
||||
.. versionadded:: 2016.11.0
|
||||
|
||||
.. _salt_salt_runner:
|
||||
|
||||
Salt's execution modules are normally available
|
||||
@ -79,8 +79,10 @@ def execute(tgt,
|
||||
kwarg=None,
|
||||
**kwargs):
|
||||
'''
|
||||
Execute `fun` on all minions matched by `tgt` and `tgt_type`.
|
||||
Parameter `fun` is the name of execution module function to call.
|
||||
.. versionadded:: Nitrogen
|
||||
|
||||
Execute ``fun`` on all minions matched by ``tgt`` and ``tgt_type``.
|
||||
Parameter ``fun`` is the name of execution module function to call.
|
||||
|
||||
This function should mainly be used as a helper for runner modules,
|
||||
in order to avoid redundant code.
|
||||
@ -92,7 +94,20 @@ def execute(tgt,
|
||||
ret1 = __salt__['salt.execute']('*', 'mod.fun')
|
||||
ret2 = __salt__['salt.execute']('my_nodegroup', 'mod2.fun2', tgt_type='nodegroup')
|
||||
|
||||
.. versionadded:: Nitrogen
|
||||
It can also be used to schedule jobs directly on the master, for example:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
schedule:
|
||||
collect_bgp_stats:
|
||||
function: salt.execute
|
||||
args:
|
||||
- edge-routers
|
||||
- bgp.neighbors
|
||||
kwargs:
|
||||
tgt_type: nodegroup
|
||||
days: 1
|
||||
returner: redis
|
||||
'''
|
||||
client = salt.client.get_local_client(__opts__['conf_file'])
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user