DevOps / Ansible Interview questions
When would you choose dynamic inventory over static inventory?
A static inventory file is fine when the set of managed hosts is small and changes rarely, since manually editing a text file is simple in that case. Dynamic inventory becomes valuable once hosts are created and destroyed frequently, such as in an auto-scaling cloud environment, where a static list would constantly go stale.
# aws_ec2 dynamic inventory plugin example plugin: amazon.aws.aws_ec2 regions: - us-east-1 filters: tag:Environment: production
Dynamic inventory plugins query a live source, cloud provider APIs (AWS, Azure, GCP), a CMDB, or container orchestration platforms, at run time, and can group hosts automatically by attributes like tags, region, or instance type. This is the right choice whenever the "truth" about which hosts exist and their properties already lives somewhere else in the infrastructure, since keeping a static file manually in sync with that source is both extra work and a source of drift the moment someone forgets to update it.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
