Your project needs a standard layout. What do you show a new hire?
BeginnerScenarioRoles, Collections and Project Structure
Answer
Situation read → Project structure.
What I'd do →
ansible.cfg
requirements.yml
site.yml
inventories/{staging,prod}/{hosts,group_vars/,host_vars/}
playbooks/
roles/
collections/
molecule/ # per role
Why → Predictable placement means anyone can find variables and roles quickly.
Interview tip → Mention one repo, one ansible.cfg checked in, and .gitignore for vault password files.
More on Roles, Collections and Project Structure
You have a 600-line playbook that sets up web, db and monitoring. How do you restructure it?BeginnerWhere do you put a variable users of your role are expected to override?BeginnerTwo roles need to run in a fixed order, such as `common` before `nginx`.BeginnerA role is used twice with different parameters in one play, but only runs once.IntermediateYou want to share roles across several repos and teams.IntermediateHow do you pin Ansible itself so a CI run today behaves like one last month?Intermediate