Ansible: How to ping a server from the command line without an ansible playbook

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)

Leave a Reply

Your email address will not be published.