Interview Prep/Ansible/Project Structure and Design

What naming conventions do you enforce?

BeginnerProductionProject Structure and Design
Answer
  • Roles: lowercase with underscores, named after the service (nginx, node_exporter).
  • Variables: role-prefixed (nginx_worker_connections), secrets prefixed vault_, internal ones __role_name_x.
  • Tasks: start with a capital letter and a verb, optionally prefixed with the role (nginx | Install package), so the run output is searchable.
  • Handlers: unique and prefixed.
  • Files: .yml extension everywhere, one style.

ansible-lint enforces most of this, which removes the style arguments from code review.

All Ansible questions Roadmap: Ansible

More on Project Structure and Design