Ad-hoc commands are like one-line playbooks to perform a specific task only. The syntax for the ad-hoc command is
ansible [pattern] -m [module] -a "[module options]"
For example, we need to reboot all servers in the staging group
ansible atlanta -a "/sbin/reboot" -u username --become [--ask-become-pass]