mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Add note about using module_refresh to refresh modules in state run
This commit is contained in:
parent
e51a8e0e4a
commit
8768e51128
@ -253,6 +253,23 @@ def sync_modules(saltenv=None, refresh=True):
|
||||
to grab the contents of the _modules directory, base is the default
|
||||
environment.
|
||||
|
||||
.. important::
|
||||
|
||||
If this function is executed using a :py:func:`module.run
|
||||
<salt.states.module.run>` state, the SLS file will not have access to
|
||||
newly synced execution modules unless a ``reload_modules`` argument is
|
||||
added to the state, like so:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
load_my_custom_module:
|
||||
module.run:
|
||||
- name: saltutil.sync_modules
|
||||
- reload_modules: True
|
||||
|
||||
See :ref:`here <reloading-modules>` for a more detailed explanation of
|
||||
why this is necessary.
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
@ -388,6 +405,24 @@ def sync_all(saltenv=None, refresh=True):
|
||||
refresh : True
|
||||
Also refresh the execution modules available to the minion.
|
||||
|
||||
.. important::
|
||||
|
||||
If this function is executed using a :py:func:`module.run
|
||||
<salt.states.module.run>` state, the SLS file will not have access to
|
||||
newly synced execution modules unless a ``reload_modules`` argument is
|
||||
added to the state, like so:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
load_my_custom_module:
|
||||
module.run:
|
||||
- name: saltutil.sync_all
|
||||
- refresh: True
|
||||
- reload_modules: True
|
||||
|
||||
See :ref:`here <reloading-modules>` for a more detailed explanation of
|
||||
why this is necessary.
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
Loading…
Reference in New Issue
Block a user