Created
November 21, 2022 09:01
-
-
Save grzs/fe5246ed4fa3a3c7f5d640e90808d4d2 to your computer and use it in GitHub Desktop.
AWK script for printing ansible runniing statistics summary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN { | |
ok=0; ch=0; ur=0; fl=0; sk=0; rs=0; ig=0 | |
} | |
{ | |
print $0 | |
gsub("[a-z]+=", "") | |
ok+=$3; ch+=$4; ur+=$5; fl+=$6; sk+=$7; rs+=$8; ig+=$9 | |
} | |
END { | |
separator=":" | |
printf("\nsum%24s ok=%-4s changed=%-4s unreachable=%-4s failed=%-4s skipped=%-4s rescued=%-4s ignored=%-4s ", | |
separator, ok, ch, ur, fl, sk, rs, ig) | |
printf("total=%s\n", ok+ch+ur+fl+sk+rs+ig) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment