Working with Ansible Inventory - Basics and Examples
· via Spacelift
Summary: Inventory decides what Ansible touches, which makes it the highest-stakes file nobody thinks about. Model environments and tiers as groups, keep variables in group_vars and host_vars next to the hosts they describe, and playbooks stay generic. Dynamic inventory is mandatory once hosts are elastic, since static files cannot chase autoscaling.
Who should read it: Ansible users graduating from a single hosts file, and anyone who has run a playbook against the wrong environment.