Add state_auto_order docs

This commit is contained in:
Thomas S Hatch 2013-08-20 11:52:10 -06:00
parent a89b74c7f1
commit e263e9a7b9

View File

@ -2,17 +2,42 @@
Ordering States
===============
When creating Salt SLS files, it is often important to ensure that they run in
a specific order. While states will always execute in the same order, that
order is not necessarily defined the way you want it.
The way in which configuration management systems are executed is a hotly
debated topic in the configuration management world. Two
major philosophies exist on the subject, to either execute in an imperative
fashion where things are executed in the order in which they are defined, or
in a declarative fashion where dependencies need to be mapped between objects.
A few tools exist in Salt to set up the correct state ordering. These tools
consist of requisite declarations and order options.
Imperative ordering is finite and generally considered easier to write, but
declarative ordering is much more powerful, flexible but generally considered
more difficult to create.
.. note::
Salt has been creted to get the best of both worlds, states are evaluated in
a finite order which garentees that states are always executed in the same
order and the states runtime is declarative, making Salt fully aware of
dependencies via the requisite system.
Salt does **not** execute :term:`state declarations <state declaration>` in
the order they appear in the source.
Also, in Salt 0.17.0 the ``state_auto_order`` option was added to Salt
which makes states get evaluated in the order in which they are defined.
State Auto Ordering
===================
..versionadded: 0.17.0
Salt always executes states in a finite manner, meaning that they will always
execute in the same order regardless of the systems that is executing them.
But in Salt 0.17.0 the ``state_auto_order`` option was added. This option
makes states get evaluated in the order in which they are defined in sls
files.
The evaluation order makes it easy to know what order the states will be
executed in, but it is important to note that the requisite system will
over ride the ordering defined in the files, and the order option described
below will also over ride the order in which states are defined in sls files.
If the classic ordering is preferred (lexicographic) then set ``state_auto_order``
to ``False`` in the master configuration file.
Requisite Statements
====================