Listing the ordering of states

181 views
Skip to first unread message

Oivvio Polite

unread,
Jun 13, 2013, 10:05:51 AM6/13/13
to salt-...@googlegroups.com
To debug my states it would be great if I could get salt to output the
order in which salt is planning to apply my states.

I'm trying to get my require statements right but it seems that there's
something wrong in my yaml because salt is trying to apply states in an
other order than I intended.

oivvio

--
Oivvio Polite - http://liberationtech.net

Joseph Hall

unread,
Jun 13, 2013, 10:35:51 AM6/13/13
to salt-...@googlegroups.com
I think you'll want to look at the state.show_lowstate function:

state.show_lowstate:

List out the low data that will be applied to this minion

CLI Example::

salt '*' state.show_lowstate

This will lay out in some detail which states, functions (listed as
"fun"), order, etc would be used to apply a state to a machine.
> --
> You received this message because you are subscribed to the Google Groups "Salt-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
"In order to create, you have to have the willingness, the desire to
be challenged, to be learning." -- Ferran Adria (speaking at Harvard,
2011)

Luminous Salt

unread,
Jun 13, 2013, 2:15:04 PM6/13/13
to salt-...@googlegroups.com
On 2013-06-13 10:35, Joseph Hall wrote:
> I think you'll want to look at the state.show_lowstate function:
>
> state.show_lowstate:
>
> List out the low data that will be applied to this minion
>
> CLI Example::
>
> salt '*' state.show_lowstate
>
> This will lay out in some detail which states, functions (listed as
> "fun"), order, etc would be used to apply a state to a machine.
>
>

Advance apologies for my ignorance..

what is "low state" and how does it differ from "high state"? What's
its purpose or when/why would you use it over highstate?

Last I checked I couldn't find a good explanation of this in the docs.


Thanks!

Oivvio Polite

unread,
Jun 13, 2013, 2:27:28 PM6/13/13
to salt-...@googlegroups.com
On Thu, Jun 13, 2013 at 08:35:51AM -0600, Joseph Hall wrote:
> I think you'll want to look at the state.show_lowstate function:
>
> state.show_lowstate:
>
> List out the low data that will be applied to this minion
>
> CLI Example::
>
> salt '*' state.show_lowstate
>

Nah. Doesn't seem to do the trick. I limited the top.sls file to only a
few simple state that I'm fairly certain are correct but show_lowstate
will not list them in the correct order.

Joseph Hall

unread,
Jun 13, 2013, 2:28:06 PM6/13/13
to salt-...@googlegroups.com
In a nutshell, think of low data as what the compiler produces based
on the information declared in your state files.

To be somewhat more detailed:

* Each piece of information in an SLS file is a piece of high data
* SLS files are combined together to form a high state
* The compiler converts a high state (how the user thinks of it) to a
low state (how Salt thinks of it)
* A low state is divided into low chunks, which are ordered by
dependency, then user-declared order, then lexigraphically
* A low chunk represents a call to a single state module
* The state module then uses that data to perform a call (or calls) to
an execution module

This is pretty low-level stuff... but the low data is close enough to
what we see as users, that it should be usable to many less technical
users to understand what Salt will be doing in a highstate call, and
in what order.

Thomas S Hatch

unread,
Jun 13, 2013, 3:26:04 PM6/13/13
to salt-...@googlegroups.com
http://docs.saltstack.com/ref/states/layers.html

The state system has layers.

The show_lowstate shows the evaluation order, not the execution order, the requisites are evaluated in the displayed order of chunks in the low state.

I should probably add a function that resolved the requisites to display the execution order, not just the evaluation order

Thomas S. Hatch  |  Founder, CTO


5272 South College Drive, Suite 301 | Murray, UT 84123

Oivvio Polite

unread,
Jun 13, 2013, 4:16:13 PM6/13/13
to salt-...@googlegroups.com
On Thu, Jun 13, 2013 at 01:26:04PM -0600, Thomas S Hatch wrote:
>
> I should probably add a function that resolved the requisites to display
> the execution order, not just the evaluation order

For newcomers, like me, I think that would be most appreciated.
Reply all
Reply to author
Forward
0 new messages