Skip to content

Commit

Permalink
Link to minion start reactor example from FAQ.
Browse files Browse the repository at this point in the history
This provides a natural solution to the chicken-and-egg problem
identified in the FAQ. It also changes the name of the event in the
reactor example, as I think we may have stopped sending the legacy
(i.e. not-namespaced) events, so the "minion_start" event in the example
would be incorrect.
  • Loading branch information
terminalmage committed Mar 21, 2017
1 parent a0b4082 commit a42be82
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion doc/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ should be opened on our tracker_, with the following information:
Why aren't my custom modules/states/etc. available on my Minions?
-----------------------------------------------------------------

Custom modules are synced to Minions when
Custom modules are synced to Minions when
:mod:`saltutil.sync_modules <salt.modules.saltutil.sync_modules>`,
or :mod:`saltutil.sync_all <salt.modules.saltutil.sync_all>` is run.
Custom modules are also synced by :mod:`state.apply` when run without
Expand All @@ -166,6 +166,11 @@ Other custom types (renderers, outputters, etc.) have similar behavior, see the
documentation for the :mod:`saltutil <salt.modules.saltutil>` module for more
information.

:ref:`This reactor example <minion-start-reactor>` can be used to automatically
sync custom types when the minion connects to the master, to help with this
chicken-and-egg issue.


Module ``X`` isn't available, even though the shell command it uses is installed. Why?
--------------------------------------------------------------------------------------
This is most likely a PATH issue. Did you custom-compile the software which the
Expand Down
7 changes: 6 additions & 1 deletion doc/topics/reactor/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ And in the master config file, add the following reactor configuration:
.. code-block:: yaml
reactor:
- 'minion_start':
- 'salt/minion/*/start':
- /srv/reactor/sync_grains.sls
This will cause the master to instruct each minion to sync its custom grains
Expand All @@ -612,3 +612,8 @@ when it starts, making these grains available when the initial :ref:`highstate
Other types can be synced by replacing ``local.saltutil.sync_grains`` with
``local.saltutil.sync_modules``, ``local.saltutil.sync_all``, or whatever else
suits the intended use case.

Also, if it is not desirable that *every* minion syncs on startup, the ``*``
can be replaced with a different glob to narrow down the set of minions which
will match that reactor (e.g. ``salt/minion/appsrv*/start``, which would only
match minion IDs beginning with ``appsrv``).

0 comments on commit a42be82

Please sign in to comment.