ansible -i hosts -m ping targethost
-i hosts defines the path to inventory file targethost is the name of the host in the hosts file
-i hosts
targethost
hosts