How would you review a pull request that adds a new role?
IntermediateScenarioRoles, Collections and Project Structure
Answer
Situation read → Quality gate.
What I'd do → Check: FQCNs, ansible-lint clean, idempotent (Molecule), defaults documented, no secrets, no_log where needed, handlers used instead of restarts, become scoped narrowly, README with variables, tags where useful, supports declared OS list.
Why → A checklist avoids opinion-based review.
Interview tip → Mention automating the checklist in CI.
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