I have the below playbook code as suggested in order to check if the inventory hosts are reachable.
--- - hosts: "{{ENV}}_*" user: "{{USER}}"