Be sure ansible is installed on your local system.
In this example I will use an AWS ec2 instance (REHL5)
The ansible command line command is:
ansible all -i <IP or host>, -m ping --private-key="~/AWS_pems/my-pem.pem" -u <user name for host machine>
(note the comma)