Skip to content

Instantly share code, notes, and snippets.

@orymate
Created September 24, 2016 10:13
Show Gist options
  • Save orymate/3a95c09e61a6f6d58661d7e0eddcb4a7 to your computer and use it in GitHub Desktop.
Save orymate/3a95c09e61a6f6d58661d7e0eddcb4a7 to your computer and use it in GitHub Desktop.
Show last salt state run's result in a more verbose format
wut () {
case "$1" in
full|terse|mixed|changes|filter) so=$1; shift ;;
v|verbose|-v) so=full; shift ;;
esac
job=$(salt-run jobs.list_jobs --out=json |
jq -r '[to_entries[]|select(.value|.Function|contains("state")).key]|max')
salt-run --force-color --out=highstate --state-output=${so:-full} \
"$@" jobs.lookup_jid $job |& less -r
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment