startup.rst 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ==============
  2. Startup States
  3. ==============
  4. Sometimes it may be desired that the salt minion execute a state run when it is
  5. started. This alleviates the need for the master to initiate a state run on a
  6. new minion and can make provisioning much easier.
  7. As of Salt 0.10.3 the minion config reads options that allow for states to be
  8. executed at startup. The options are `startup_states`, `sls_list`, and
  9. `top_file`.
  10. The `startup_states` option can be passed one of a number of arguments to
  11. define how to execute states. The available options are:
  12. :ref:`highstate <running-highstate>`
  13. Execute :py:func:`state.apply <salt.modules.state.apply_>`
  14. sls
  15. Read in the ``sls_list`` option and execute the named sls files
  16. top
  17. Read in the ``top_file`` option and execute states based on that top file
  18. on the Salt Master
  19. Examples:
  20. ---------
  21. Execute :py:func:`state.apply <salt.modules.state.apply_>` to run the
  22. :ref:`highstate <running-highstate>` when starting the minion:
  23. .. code-block:: yaml
  24. startup_states: highstate
  25. Execute the sls files `edit.vim` and `hyper`:
  26. .. code-block:: yaml
  27. startup_states: sls
  28. sls_list:
  29. - edit.vim
  30. - hyper