We have already seen a handful of ad hoc commands so far in this book, but to recap, they are single commands you can run with Ansible, making use of Ansible modules without the need to create or save playbooks. They are very useful for performing quick, one-off tasks on a number of remote machines or for testing and understanding the behavior of the Ansible modules that you intend to use in your playbooks. They are both a great learning tool and a quick and dirty (because you never document your work with a playbook!) automation solution.
As with every Ansible example, we need an inventory to run against. Let's reuse our production-inventory file from before:
[frontends_na_zone]frontend1-na.example.comfrontend2-na.example.com ...