DevOps / Ansible Interview questions
List the components of an Ansible role directory?
A standard role follows a fixed layout that Ansible auto-discovers, with each subdirectory holding a specific kind of content:
- tasks/main.yml - the main list of tasks the role performs.
- handlers/main.yml - handlers the role's tasks can notify.
- defaults/main.yml - lowest-precedence default variable values.
- vars/main.yml - higher-precedence, role-specific variables.
- templates/ - Jinja2 template files rendered onto target hosts.
- files/ - static files copied as-is to target hosts.
- meta/main.yml - role metadata and dependencies on other roles.
Any directory that isn't needed can simply be omitted; Ansible only looks for what's present, which keeps small roles lightweight while still supporting the full structure when a role grows more complex.
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...
