salt/doc/ref/file_server/dynamic-modules.rst

54 lines
1.7 KiB
ReStructuredText
Raw Normal View History

.. _module-sync:
.. _dynamic-module-distribution:
===========================
2012-01-14 00:44:16 +00:00
Dynamic Module Distribution
===========================
.. versionadded:: 0.9.5
Custom Salt execution, state, and other modules can be distributed to Salt
minions using the Salt file server.
2012-10-11 06:36:07 +00:00
Under the root of any environment defined via the :conf_master:`file_roots`
option on the master server directories corresponding to the type of module can
be used.
2012-02-26 06:19:09 +00:00
The directories are prepended with an underscore:
- :file:`_beacons`
- :file:`_modules`
- :file:`_grains`
- :file:`_renderers`
- :file:`_returners`
- :file:`_states`
- :file:`_output`
- :file:`_utils`
2012-02-26 06:19:09 +00:00
The contents of these directories need to be synced over to the minions after
2012-05-23 04:43:12 +00:00
Python modules have been created in them. There are a number of ways to sync
the modules.
2012-02-26 06:19:09 +00:00
Sync Via States
===============
The minion configuration contains an option ``autoload_dynamic_modules``
which defaults to ``True``. This option makes the state system refresh all
2012-02-26 06:19:09 +00:00
dynamic modules when states are run. To disable this behavior set
:conf_minion:`autoload_dynamic_modules` to ``False`` in the minion config.
2012-02-26 06:19:09 +00:00
When dynamic modules are autoloaded via states, modules only pertinent to
the environments matched in the master's top file are downloaded.
2012-05-23 04:47:30 +00:00
This is important to remember, because modules can be manually loaded from
any specific environment that environment specific modules will be loaded
2012-05-23 04:47:30 +00:00
when a state run is executed.
2012-02-26 06:19:09 +00:00
Sync Via the saltutil Module
============================
2012-01-14 00:44:16 +00:00
2012-02-26 06:19:09 +00:00
The saltutil module has a number of functions that can be used to sync all
or specific dynamic modules. The saltutil module function ``saltutil.sync_all``
will sync all module types over to a minion. For more information see:
:mod:`salt.modules.saltutil`