I am trying to suppress all output from salt-call/salt state.apply unless there is an error or warning of any kind; no output means no summary, either.
No combination of --state-verbose or --state-output silences the summary.
Adding --out=quiet gets rid of the summary but also warnings and errors, providing only a return code.
For now, I am handling it this way:
salt-call state.apply <my_state> --state_output=mixed --state_verbose=false --out-file=/tmp/state-out-tmp-$$.txt
(($?)) && cat /tmp/state-out-tmp-$$.txt
rm /tmp/state-out-tmp-$$.txt
... but this seems to be overkill.
Is there some combination of options I am missing?
The simple way is to output json and pipe it through an additional parsing step:
A cleaner way is to implement your own outputter that returns exactly what you want to see:
Note that errors and warnings should also be logged, so you could simply go for: