Inventory and Ad Hoc Commands
Part of the Ansible course
You now know Ansible connects to machines over SSH and describes desired state instead of steps. But before Ansible can talk to anything, it needs an address book: a list of the machines you want it to manage, and some way to group them so you can say "all the web servers" instead of naming each one by hand.
Once an inventory exists, you do not have to jump straight to a full playbook to get value out of Ansible. You can fire off a single command against every host in the inventory, or just one group of them, and see the result immediately. Those one-off commands are called ad hoc commands, and they are how most people spend their first hour with Ansible: poking at machines, checking things, running quick fixes, before...
Want to learn Ansible Inventory and Ad Hoc Commands in a real environment?
Click below, get a fresh Linux box with Ansible ready to go, and work through Inventory and Ad Hoc Commands hands-on with an AI tutor that knows your code.
Start this lessonInventory and Ad Hoc CommandsWhat you'll learn
- Inventory file
- Host groups
- Ad hoc commands
- Ansible ping
- Ansible -m
- Ansible -a
Read this lesson in your language
All lessons in this course
12 lessons- 1What Is Ansible20 min
- 2Inventory and Ad Hoc Commands25 min
- 3Your First Playbook30 min
- 4Tasks, Modules, and Handlers30 min
- 5Variables and Facts30 min
- 6Templates with Jinja230 min
- 7Loops and Conditionals30 min
- 8Roles and Galaxy35 min
- 9Vault and Secrets25 min
- 10Tags and Debugging25 min
- 11Collections and Plugins25 min
- 12Capstone: Multi Host Deploy60 min
