Problem Statement
Describe how dynamic inventory works in Ansible and where it is used.
Explanation
Dynamic inventory allows Ansible to fetch host information directly from external sources like AWS, Azure, or Kubernetes rather than using static files.
It uses scripts or plugins that query APIs to retrieve up-to-date lists of instances and their metadata. This is particularly useful in cloud or container environments where servers frequently change, ensuring accurate targeting of hosts during automation runs.
