Files
computer-playbook/docs/contributing/code/frameworks/ansible.md
T

1.2 KiB

Back to Frameworks

Ansible

Use this section for Ansible-specific guidance that applies across the repository.

Common

Use these shared rules as the default baseline for role values and path handling.

Paths

Build filesystem paths with path_join instead of concatenating path segments as strings.

Variables and Constants

These rules keep shared role values explicit, reusable, and easy to read.

  • Prefer defining shared fixed role variables once in vars/main.yml as the single source of truth instead of recomputing them with lookup() or dotted variable composition in *.j2 or *.yml.
  • Variables that are defined once and treated as constants must be uppercase.

Role Design

Use this section for role-structure guidance around images, files, and constants.

Container Images

Use this rule when a role needs a Docker image definition.

  • Prefer Dockerfile over Dockerfile.j2; only use Dockerfile.j2 when build-time templating is genuinely required.

For documentation, comments, semantics, and writing guidance, see Documentation.

For test commands and testing standards, see Testing and Validation.