Conversation
…, inline HTML, and code block style
… README for Ansible command usage
…gs and prevent fact injection as variables
…-install-base.txt
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds nested Ansible config, Pipfile, playbooks and task files for Ubuntu 24.x system setup (APT, CUDA, VS Code, Brave), example variables and Ansible ignore, and updates repository docs, linting, and gitignore entries. ChangesAnsible Automation Setup
Repository Development Infrastructure
Sequence Diagram(s)sequenceDiagram
participant SetupPlay as Setup Play
participant TaskImporter as Task Importer
participant AptService as APT Tasks
participant CUDAInstaller as CUDA Tasks
SetupPlay->>TaskImporter: import apt-upgrade / apt-install / releases
TaskImporter->>AptService: run apt upgrade & package installs
TaskImporter->>CUDAInstaller: run cuda-toolkit tasks when enabled
🎯 3 (Moderate) | ⏱️ ~25 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideAdds an Ansible-based Ubuntu 24.x setup workflow (with CUDA, VS Code, Brave, and apt package management), Pipenv-managed Ansible tooling, and documentation/guidance updates for contributors and agents, while refining markdown linting configuration. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The CUDA Toolkit role currently hardcodes
cuda_toolkit_packageinsetup-linux.ymland always runsnvidia-smiwhennvidia.cuda_toolkitis true; consider moving the package name intovariables.ymland guarding thenvidia-smicall with a check for the binary’s presence (e.g.,stat/which) so the playbook behaves more predictably on hosts without NVIDIA drivers or GPUs. - Both the Brave and VS Code repository setup tasks directly manage keys and source files via
get_urlandcommand; you might want to standardize these on higher-level Ansible modules likeansible.builtin.deb822_repositoryorapt_repository+get_url+createspatterns to improve idempotence and reduce the chance of repeated work or partial configuration if a step fails.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The CUDA Toolkit role currently hardcodes `cuda_toolkit_package` in `setup-linux.yml` and always runs `nvidia-smi` when `nvidia.cuda_toolkit` is true; consider moving the package name into `variables.yml` and guarding the `nvidia-smi` call with a check for the binary’s presence (e.g., `stat`/`which`) so the playbook behaves more predictably on hosts without NVIDIA drivers or GPUs.
- Both the Brave and VS Code repository setup tasks directly manage keys and source files via `get_url` and `command`; you might want to standardize these on higher-level Ansible modules like `ansible.builtin.deb822_repository` or `apt_repository` + `get_url` + `creates` patterns to improve idempotence and reduce the chance of repeated work or partial configuration if a step fails.
## Individual Comments
### Comment 1
<location path=".ansible/playbooks/setup-linux.yml" line_range="7-8" />
<code_context>
+ become: true
+ vars_files:
+ - ../variables.yml
+ vars:
+ cuda_toolkit_package: cuda-toolkit-13-1
+ pre_tasks:
+ - name: Validate host OS is Ubuntu 24.x
</code_context>
<issue_to_address>
**suggestion:** Make `cuda_toolkit_package` a configurable variable in the shared variables file rather than hardcoding it in the playbook.
Other tunables (APT packages, release toggles, etc.) already live in `variables.yml` with a `variables-example.yml`. Putting `cuda_toolkit_package` there as well keeps user-facing configuration centralized and easier to override per host/profile.
Suggested implementation:
```
vars_files:
- ../variables.yml
pre_tasks:
```
To fully implement this change, you should also:
1. Add `cuda_toolkit_package` (with a sensible default, e.g. `cuda-toolkit-13-1`) to `variables.yml`.
2. Mirror that entry in `variables-example.yml` so users know it’s a configurable knob.
3. If any hosts/profiles need different CUDA versions, override `cuda_toolkit_package` in the appropriate inventory/group_vars/host_vars as per your existing convention.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| vars: | ||
| cuda_toolkit_package: cuda-toolkit-13-1 |
There was a problem hiding this comment.
suggestion: Make cuda_toolkit_package a configurable variable in the shared variables file rather than hardcoding it in the playbook.
Other tunables (APT packages, release toggles, etc.) already live in variables.yml with a variables-example.yml. Putting cuda_toolkit_package there as well keeps user-facing configuration centralized and easier to override per host/profile.
Suggested implementation:
vars_files:
- ../variables.yml
pre_tasks:
To fully implement this change, you should also:
- Add
cuda_toolkit_package(with a sensible default, e.g.cuda-toolkit-13-1) tovariables.yml. - Mirror that entry in
variables-example.ymlso users know it’s a configurable knob. - If any hosts/profiles need different CUDA versions, override
cuda_toolkit_packagein the appropriate inventory/group_vars/host_vars as per your existing convention.
There was a problem hiding this comment.
Pull request overview
Adds an Ansible-based Linux setup workflow for Ubuntu 24.x hosts, alongside documentation and tooling configuration to support local and automated validation.
Changes:
- Introduces
.ansible/playbooks, task files, variables template, inventory, and Pipenv-managed Ansible dependencies. - Documents Ansible setup, devcontainer usage, and pre-commit validation workflows.
- Updates markdownlint/gitignore configuration and adds ansible-lint ignore scaffolding.
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
README.md |
Documents Ansible setup and development validation workflows. |
AGENTS.md |
Adds contributor/agent guidance for validation and troubleshooting. |
.markdownlint.yaml |
Expands markdownlint rule configuration. |
.gitignore |
Ignores Node dependencies and local Ansible variables. |
.ansible/variables-example.yml |
Provides default package and feature flags for Linux setup. |
.ansible/playbooks/setup-linux.yml |
Adds the main Ubuntu 24.x setup playbook. |
.ansible/playbooks/tasks/apt-upgrade.yml |
Adds APT upgrade task. |
.ansible/playbooks/tasks/apt-install.yml |
Adds configurable APT package installation task. |
.ansible/playbooks/tasks/apt-release-code.yml |
Adds VS Code APT repository and install tasks. |
.ansible/playbooks/tasks/apt-release-brave.yml |
Adds Brave APT repository and install tasks. |
.ansible/playbooks/tasks/cuda-toolkit.yml |
Adds CUDA Toolkit installation and NVIDIA status check tasks. |
.ansible/Pipfile |
Defines the Ansible Pipenv environment. |
.ansible/Pipfile.lock |
Locks Ansible environment dependencies. |
.ansible/.ansible.cfg |
Adds Ansible configuration for the new workflow. |
.ansible.cfg |
Removes the previous top-level Ansible configuration. |
.ansible-lint-ignore |
Adds ansible-lint ignore file placeholder. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (2)
.ansible/Pipfile (1)
7-10: ⚡ Quick winAlign Pipfile versions with the pre-commit Ansible toolchain.
Using
*here can pull versions that diverge from your pinned pre-commit contract (ansible-lint+ constrainedansible-core), which makes local behavior inconsistent.🔧 Suggested pinning approach
[packages] -ansible = "*" +ansible = "==9.*" # or a specific tested version used by this repo [dev-packages] -ansible-lint = "*" +ansible-lint = "==6.22.2"You can verify consistency by comparing resolved Pipenv lock versions with
.pre-commit-config.yamlconstraints.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.ansible/Pipfile around lines 7 - 10, Replace wildcard pins in the Pipfile dev-packages with explicit versions that match the pre-commit toolchain: pin ansible-lint to the same version used in your .pre-commit-config.yaml (or the resolved lock) and pin ansible (or ansible-core) to the constrained version specified by the pre-commit hook; update the entries for ansible and ansible-lint in the Pipfile dev-packages to those exact versions (instead of "*") so local pipenv resolution matches the pre-commit contract, then regenerate the Pipfile.lock to verify consistency..ansible/playbooks/tasks/cuda-toolkit.yml (1)
2-2: 💤 Low valueHardcoded version in task name may mislead.
The task name specifies "CUDA Toolkit 13.1" but the actual version depends on the
cuda_toolkit_packagevariable value. If the variable points to a different version, the task name becomes inaccurate.♻️ Generic task name suggestion
-- name: Install CUDA Toolkit 13.1 package +- name: Install CUDA Toolkit package🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.ansible/playbooks/tasks/cuda-toolkit.yml at line 2, The task name "Install CUDA Toolkit 13.1 package" is hardcoded and can be misleading; update the Ansible task in .ansible/playbooks/tasks/cuda-toolkit.yml to use a generic or variable-based name that reflects the actual package being installed (e.g., "Install CUDA Toolkit package" or "Install CUDA Toolkit {{ cuda_toolkit_package }}"), and ensure the change refers to the same task that uses the cuda_toolkit_package variable so the name always matches the package being installed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.ansible/playbooks/setup-linux.yml:
- Around line 29-35: The when clauses on the import_tasks for
"tasks/apt-release-code.yml" and "tasks/apt-release-brave.yml" can raise
undefined-variable errors when apt or apt.releases is missing; update each when
to first guard existence (e.g. apt is defined and apt.releases is defined) and
then evaluate the flag with default(false) and bool — for example: replace
"when: apt.releases.code | default(false) | bool" with a guarded expression like
"when: apt is defined and apt.releases is defined and (apt.releases.code |
default(false) | bool)" and do the analogous change for apt.releases.brave.
- Around line 7-8: The play-level variable cuda_toolkit_package in the play's
vars block is overriding user-provided values from .ansible/variables.yml;
remove the cuda_toolkit_package entry from the play vars and instead provide it
via an included vars_files or a role default (e.g., move the default into the
role's defaults/main.yml or ensure .ansible/variables.yml is listed in
vars_files and contains cuda_toolkit_package), so user-supplied values in
.ansible/variables.yml can override the default.
In @.ansible/playbooks/tasks/apt-release-brave.yml:
- Around line 7-17: The two ansible.builtin.get_url tasks ("Download Brave
browser keyring" and "Download Brave browser sources list") download
security-sensitive artifacts without integrity checks; update each get_url
invocation to include a checksum parameter (use the sha256 keyed form, e.g.
checksum: "sha256:<computed-hash>") pointing to the correct SHA256 of the
respective file so Ansible validates the download before writing to dest,
keeping the existing dest and mode fields unchanged.
In @.ansible/playbooks/tasks/apt-release-code.yml:
- Around line 17-21: The task "Download Microsoft GPG key" using
ansible.builtin.get_url lacks a checksum, so add the get_url checksum field
(e.g. checksum: "sha256:<expected-fingerprint>" or appropriate hash) to pin the
download integrity for /etc/apt/keyrings/packages.microsoft.asc; locate the task
by the name "Download Microsoft GPG key" or the get_url call and update it to
include the checksum value you verified from the Microsoft key distribution.
In @.ansible/playbooks/tasks/cuda-toolkit.yml:
- Around line 2-7: The task uses an undefined variable cuda_toolkit_package
while only a boolean flag nvidia.cuda_toolkit exists; add a package-name
variable (e.g., set cuda_toolkit_package: "cuda-toolkit-13-1" or an appropriate
package string) to the variables example and update the install task to run only
when the boolean is true (e.g., change the conditional to check
nvidia.cuda_toolkit and not ansible_check_mode) so the apt task installs '{{
cuda_toolkit_package }}' only when the flag is enabled.
In @.ansible/variables-example.yml:
- Around line 41-42: The variables file defines only the boolean cuda_toolkit
but the install task expects cuda_toolkit_package; add a new variable named
cuda_toolkit_package alongside cuda_toolkit and set it to the correct CUDA
toolkit package name (e.g., the distribution package you install on target
hosts) so the installation task can reference that variable; ensure the variable
name exactly matches cuda_toolkit_package used in the task.
---
Nitpick comments:
In @.ansible/Pipfile:
- Around line 7-10: Replace wildcard pins in the Pipfile dev-packages with
explicit versions that match the pre-commit toolchain: pin ansible-lint to the
same version used in your .pre-commit-config.yaml (or the resolved lock) and pin
ansible (or ansible-core) to the constrained version specified by the pre-commit
hook; update the entries for ansible and ansible-lint in the Pipfile
dev-packages to those exact versions (instead of "*") so local pipenv resolution
matches the pre-commit contract, then regenerate the Pipfile.lock to verify
consistency.
In @.ansible/playbooks/tasks/cuda-toolkit.yml:
- Line 2: The task name "Install CUDA Toolkit 13.1 package" is hardcoded and can
be misleading; update the Ansible task in
.ansible/playbooks/tasks/cuda-toolkit.yml to use a generic or variable-based
name that reflects the actual package being installed (e.g., "Install CUDA
Toolkit package" or "Install CUDA Toolkit {{ cuda_toolkit_package }}"), and
ensure the change refers to the same task that uses the cuda_toolkit_package
variable so the name always matches the package being installed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 989f635c-700d-4646-89c6-5f3fce2c65f8
⛔ Files ignored due to path filters (2)
.ansible/Pipfile.lockis excluded by!**/*.lockpackage-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (15)
.ansible-lint-ignore.ansible.cfg.ansible/.ansible.cfg.ansible/Pipfile.ansible/playbooks/setup-linux.yml.ansible/playbooks/tasks/apt-install.yml.ansible/playbooks/tasks/apt-release-brave.yml.ansible/playbooks/tasks/apt-release-code.yml.ansible/playbooks/tasks/apt-upgrade.yml.ansible/playbooks/tasks/cuda-toolkit.yml.ansible/variables-example.yml.gitignore.markdownlint.yamlAGENTS.mdREADME.md
💤 Files with no reviewable changes (1)
- .ansible.cfg
|
Actionable comments posted: 0 |
|
Actionable comments posted: 0 |
|
Actionable comments posted: 0 |
Added curl, fdupes, gawk, gdb, gpg, gzip, p7zip, parallel, tmux, and wget to the variables example.
Removed google-hangouts and skype casks from Brewfile.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Summary by Sourcery
Add Ansible-based automation for configuring Ubuntu 24.x Linux hosts and refresh contributor tooling documentation.
New Features:
Enhancements:
Summary by CodeRabbit
New Features
Documentation
Chores