Parse ansible playbook summary into json payload for DataDog. This is not expected to be useful as-is but could provide a starting point for your own customisations.
export DATADOG_API_KEY=topsecret
export DATADOG_APP_KEY=opensesame
pip3 install -r requirements.txt
python3 playbook_summary_to_dd.py --playbook-file my-playbook-file.yml
Expects an external process to have created an input file named playbook_summary.txt in the same directory. This could be generated by grepping output of a playbook run to get just the summary lines as shown in the example below:
someserver-10-100-1-10 : ok=145 changed=1 unreachable=0 failed=0 skipped=96 rescued=0 ignored=0
someserver-10-100-1-11 : ok=145 changed=0 unreachable=0 failed=0 skipped=96 rescued=0 ignored=0
someserver-10-100-1-12 : ok=145 changed=0 unreachable=0 failed=0 skipped=96 rescued=0 ignored=0
someserver-10-100-1-13 : ok=145 changed=0 unreachable=0 failed=0 skipped=96 rescued=0 ignored=0
someserver-10-100-1-14 : ok=145 changed=0 unreachable=0 failed=0 skipped=96 rescued=0 ignored=0