Style guide

In general the Ansible best practices are used. These are the explicit conventions for the roles. The same text is available to coding assistants in AGENTS.md in every role.

Development focus ordering

  1. Focus on the intent of the role in meta/main.yml.
  2. Focus on user variables, defined in defaults/main.yml.
  3. Focus on role variables, defined in vars/main.yml.
  4. Focus on tasks, templates and files.

Meta

User variables

Defined in defaults/main.yml.

Role variables

Defined in vars/main.yml.

Tasks

Handlers

Templates

Files

Molecule

Linting

All roles pass ansible-lint, configured in .ansible-lint (it excludes the molecule and meta preferences files and enables name[prefix]). Lint has to pass before the Molecule job runs in CI, see testing.

No role skips lint rules for the whole role. Where a single task can’t meet a rule, an inline # noqa comment is used on that task only, with the rule name.