Ansible interview question
What is dynamic inventory, and why use it in the cloud?
Definition Asked in DevOps Engineer interviews
Summary
A dynamic inventory asks a source of truth (AWS, Azure, GCP, VMware, a CMDB) for the current hosts when the playbook starts, instead of reading a hand-maintained file. In the cloud, where instances come and go with autoscaling, it keeps Ansible's view of the fleet accurate and lets you group hosts by tags.
Keep reading with a membership
The full answer with examples, key points and comparisons is part of the membership, along with every other interview answer, progress tracking and Daily Review. Most-asked answers stay free to read.
More Ansible questions
- Write an Ansible playbook that installs Nginx, deploys its configuration, enables the service and restarts it only when the configuration changes.
- What is idempotency in Ansible, and how do you keep your own tasks idempotent?
- Explain Ansible's architecture: control node, inventory, modules, playbooks, roles and handlers.
- Explain serial, delegate_to, when and notify in Ansible.
- How would you automate TLS certificate installation and renewal with Ansible?
- How would you configure 100 Linux servers consistently with Ansible?
- How do Ansible and Terraform work together in one delivery pipeline?
- A playbook run fails halfway through 50 hosts. What do you do?