ad hoc command

A single Ansible module run against a set of hosts straight from the command line, without writing a playbook.

In more detail

It has three parts: a host pattern, a module after -m, and the module's arguments after -a. Ad hoc commands suit questions and one-off recovery work while you watch the output. Anything you will need to repeat or explain later belongs in a playbook, because nothing about an ad hoc command is saved or reviewed.

Example

ansible all -m ansible.builtin.debug -a msg=hello

Related terms

Taught in

References

Certification courses