thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

DevOps & Automation · Foundational

Ansible Ad-Hoc Command

A one-off Ansible command run from the CLI to execute a single module against hosts without writing a playbook.

Definition

Ad-hoc commands are useful for quick checks or simple changes, such as pinging hosts or restarting a service.

Example

ansible webservers -m ansible.builtin.ping

Exam tip

Use ad-hoc for one-time tasks; use playbooks for repeatable automation.

Related terms