Static Limits & the Inventory Plugin Model
Why fleets need dynamic sources.
Static Limits & the Inventory Plugin Model is a free Ansible Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Ansible Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Static Files Go Stale
A static inventory is a hand-written list of hosts. The moment a server is created or destroyed in the cloud, that file is out of date.
Cloud Fleets Change Constantly
Auto-scaling groups add and remove instances by the minute. Keeping a static file in sync with a living fleet is a losing, error-prone battle. ☁️
Enter Dynamic Inventory
A dynamic inventory asks the live source of truth for hosts at runtime. Ansible queries your cloud, so the list is always current.
Two Ways: Scripts vs Plugins
Historically you used executable inventory scripts that printed JSON. The modern, supported way is an inventory plugin shipped in a collection.
What a Plugin Returns
An inventory plugin connects to a source, fetches hosts, and hands Ansible groups, hostnames, and variables, all built fresh on every run.
Configure with a YAML File
You enable a plugin by writing a small YAML config file. The key plugin names which plugin to load and parse the file.
plugin: amazon.aws.aws_ec2
regions:
- us-east-1The Magic Filename Suffix
For Ansible to auto-detect a plugin config, the file should end in .aws_ec2.yml or .yaml, matching the plugin name.
inventory.aws_ec2.ymlEnable Plugins in ansible.cfg
Inventory plugins must be enabled. List the ones you trust under enable_plugins in the inventory section of ansible.cfg.
[inventory]
enable_plugins = amazon.aws.aws_ec2Pass It Like Any Inventory
Point Ansible at the plugin config with -i, exactly as you would a static file. Ansible sees the suffix and runs the plugin.
ansible-inventory -i inventory.aws_ec2.yml --graphInspect Before You Run
The ansible-inventory command renders the result so you can confirm which hosts and groups the plugin discovered before any play runs.
ansible-inventory -i inventory.aws_ec2.yml --listPlugins Ship in Collections
Each cloud provider ships its inventory plugin inside a collection, like amazon.aws or google.cloud, installed from Ansible Galaxy.
Quick Check
Pick the modern dynamic inventory approach.
Recap
Static files rot as fleets change. Inventory plugins, enabled in ansible.cfg and configured by a YAML file, query live sources every run. ✅
Frequently asked questions
Is the “Static Limits & the Inventory Plugin Model” lesson free?
Yes — the full text of “Static Limits & the Inventory Plugin Model” is free to read here on the web, and the Ansible Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Ansible Academy course, upgrade to CoddyKit PRO.
What will I learn in “Static Limits & the Inventory Plugin Model”?
Why fleets need dynamic sources. You practise Ansible Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Ansible Academy?
No prior experience is required. Ansible Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Static Limits & the Inventory Plugin Model” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Ansible Academy lesson?
Yes. Every Ansible Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Static Limits & the Inventory Plugin Model
- The aws_ec2 Inventory Plugin
- constructed: Group Hosts by Tags
- Caching & Multiple Inventory Sources