## AD HOC COMMANDS

Ansible Terminal

    # Check connections (submarine ping, not ICMP)
     ansible all -m ping

    # Run a command on all the hosts in the web group
     ansible web -m command -a "uptime"

    # Collect and display known facts
     ansible localhost -m setup

Ad-hoc commands are quick checks on your servers that you don’t want to preserve in an Ansible playbook.

An ad-hoc command can be used to do some tasks that you might not necessarily want to write a full playbook and save for later.

This is a good place to start to understand the basics of what Ansible can do prior to learning about playbooks where the true power of Ansible automation lies.

For more information see Introduction To Ad-Hoc Commands.