.zshrc.local
:
# ansible ara functions
function ara_playbooks() { ara playbook list --limit ${1:=10} }
function ara_playbooks_checkrun() { ara playbook list --label "check:True" --limit ${1:=10} }
function ara_playbooks_fullrun() { ara playbook list --label "check:True" --limit ${1:=10} }
function ara_last() { ara playbook list --limit 1 -c id -f value }
function ara_hosts_changed() { ara result list --playbook $1 --limit 100 --resolve -c id -c host --changed }
function ara_hosts_failed() { ara result list --playbook $1 --limit 100 --resolve -c id -c host --status failed }
function ara_tasks_changed() { ara result list --playbook $1 --resolve --changed --status ok -c id -c task -c host }
function ara_tasks_failed() { ara result list --playbook $1 --limit 100 --resolve --status failed -c id -c task -c host }
function ara_task_diff() { TASK_ID=$1; diff -u <(ara result show $TASK_ID -f json --with-content | jq ".content.diff[].before" -r) <(ara result show $TASK_ID -f json --with-content | jq ".content.diff[].after" -r) }
function ara_task_contentmsg() { ara result show --with-content -f json $1 | jq .content.msg }