- Sync environment:
uv sync(Handles all dependencies frompyproject.toml) - Update lockfile:
uv lock --upgrade - Run commands: Use
uv run <command>(e.g.,uv run ansible-playbook site.yml)
- Lint all playbooks:
uv run ansible-lint - Lint a specific file:
uv run ansible-lint <path/to/file.yml> - Run the main playbook:
uv run ansible-playbook site.yml - Run with tags:
uv run ansible-playbook site.yml --tags <tag_name>
- Formatting: Adhere to YAML best practices.
- Braces: Max one space inside braces.
- Line Length: Disabled (no strict line length).
- Naming Conventions:
- Role names: Follow
ansible-lintrecommendations. - Variable names: Follow
ansible-lintrecommendations.
- Role names: Follow
- Truthiness: Use explicit "yes", "no", "true", "false" for boolean values.
- Imports: Use Fully Qualified Collection Names (FQCN) for built-in modules.
- Error Handling: Favor
failed_whenandchanged_whenoverignore_errorsto maintain idiomatic code. Useno_log: truefor tasks involving secrets. - Inventory: Use the YAML inventory at
inventory/hosts.yml.