The return data from the Highstate command is a standard data structure which is parsed by the highstate outputter to deliver a clean and readable set of information about the HighState run on minions.
Two configurations can be set to modify the highstate outputter. These values
can be set in the master config to change the output of the salt
command or
set in the minion config to change the output of the salt-call
command.
By default state_verbose is set to True, setting this to False will instruct the highstate outputter to omit displaying anything in green, this means that nothing with a result of True and no changes will not be printed
The highstate outputter has six output modes,
full
, terse
, mixed
, changes
and filter
The default is set to full
, which will display many lines of detailed
information for each executed chunk.
If terse
is used, then the output is greatly simplified and shown in
only one line.
If mixed
is used, then terse output will be used unless a state
failed, in which case full output will be used.
If changes
is used, then terse output will be used if there was no
error and no changes, otherwise full output will be used.
If filter
is used, then either or both of two different filters can be
used: exclude
or terse
.
for
exclude
, state.highstate expects a list of states to be excluded (orNone
) followed byTrue
for terse output orFalse
for regular output. Because of parsing nuances, if only one of these is used, it must still contain a comma. For instance: exclude=True,.for
terse
, state.highstate expects simplyTrue
orFalse
.
These can be set as such from the command line, or in the Salt config as state_output_exclude or state_output_terse, respectively.
The output modes have one modifier:
full_id
, terse_id
, mixed_id
, changes_id
and filter_id
If _id
is used, then the corresponding form will be used, but the value for name
will be drawn from the state ID. This is useful for cases where the name
value might be very long and hard to read.
If state_output uses the terse output, set this to True for an aligned output format. If you wish to use a custom format, this can be set to a string.
Set state_output_pct to True in order to add "Success %" and "Failure %" to the "Summary" section at the end of the highstate output.
Set state_compress_ids to True to aggregate information about states which have multiple "names" under the same state ID in the highstate output. This is useful in combination with the terse_id value set in the state_output option when states are using the names state parameter.
Example usage:
If state_output: filter
is set in the configuration file:
salt '*' state.highstate exclude=None,True
means to exclude no states from the highstate and turn on terse output.
salt twd state.highstate exclude=problemstate1,problemstate2,False
means to exclude states problemstate1
and problemstate2
from the highstate, and use regular output.
Example output for the above highstate call when top.sls
defines only
one other state to apply to minion twd
:
twd:
Summary for twd
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1
Example output with no special settings in configuration files:
myminion:
----------
ID: test.ping
Function: module.run
Result: True
Comment: Module function test.ping executed
Changes:
----------
ret:
True
Summary for myminion
------------
Succeeded: 1
Failed: 0
------------
Total: 0
The HighState Outputter is only meant to be used with the state.highstate function, or a function that returns highstate return data.