how to ping all hosts in ansible code example Example: Ansible ping hosts $ ansible <hostgroup-name> -m ping