I'd argue Ansible is the wrong tool for Root Cause Analysis of server crashes or reboots. Ansible is a fantastic tool for server configuration automation, for server deployment and for many other usecases, but it won't help you correlate events or analyze crashes in the way you need.
First of all, I'd start configuring all those messages in a log aggregation service (merely a central rsyslog, or something more elaborate), so alarms can be triggered in advance.
Then I'd ensure I have a working kdump configuration: https://access.redhat.com/solutions/6038 . A working kdump configuration is critical to analyze kernel dumps, and to leverage Red Hat Support. Also ABRT is very useful when analyzing application crashes: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/system_administ... .
For HP iLO / Dell iDrac, I'd ensure the output of " hpasmcli -s 'show iml' ; hpasmcli -s 'show iml'' is sent to a monitoring system. Or configured directly in the iLo/iDrac to be sent to the central log collection system and worked proactively if they are environmental issues (faulty ram / power supply / raid / temperature, etc).
Finally, for RHEL users it's also advisable to leverage Red Hat Insights, a free tool that can proactively detect configuration issues and propose fixes in advance: https://www.redhat.com/en/technologies/management/insights .
Hope this helps
A collaborative learning environment, enabling open source skill development.