How to capture unreachable host and authentication failure host

Hi Team,

We are running a task against 1000 network devices, We get a few hosts failed and ansible skips those hosts in the next task.

We are generating a report in the end , We need to have those unreachable hosts and authentication failure hosts in the report.

Can anyone help me ?

Thanks

Sounds like you could utilize the ignore_unreachable keyword:

https://docs.ansible.com/ansible/latest/reference_appendices/playbooks_keywords.html#term-ignore-unreachable