Fix QEMU permission denied for agent-based installs#86
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dhensel-rh The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe agent-install ACL task now grants qemu read/execute access to the user’s home directory and the dev-scripts path instead of ChangesAgent install ACL paths
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested labels
🚥 Pre-merge checks | ✅ 10 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (10 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@deploy/openshift-clusters/roles/dev-scripts/install-dev/tasks/create.yml`:
- Around line 26-27: `dev_scripts_path` is being used directly as an ACL target
even though its default value is relative, so the path may not resolve to the
actual directory under `ansible_env.HOME`. Update the ACL setup in `create.yml`
to normalize `dev_scripts_path` before passing it to the ACL task, using the
same resolved path consistently with `ansible_env.HOME` and the
`dev_scripts_path` variable so the QEMU process gets the intended permissions.
🪄 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: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: de414b6e-307d-45a9-8a1b-016a7e2891ad
📒 Files selected for processing (1)
deploy/openshift-clusters/roles/dev-scripts/install-dev/tasks/create.yml
| - "{{ ansible_env.HOME }}" | ||
| - "{{ dev_scripts_path }}" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Normalize dev_scripts_path before using it as an ACL target.
dev_scripts_path is relative by default (openshift-metal3/dev-scripts in defaults/main.yml), so Line 27 still does not point at the real directory under {{ ansible_env.HOME }} unless inventories override it with an absolute path. That means the default agent-install path can still miss the ACL the QEMU process needs.
Suggested fix
loop:
- "{{ ansible_env.HOME }}"
- - "{{ dev_scripts_path }}"
+ - "{{ dev_scripts_path if dev_scripts_path.startswith('/') else ansible_env.HOME ~ '/' ~ dev_scripts_path }}"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - "{{ ansible_env.HOME }}" | |
| - "{{ dev_scripts_path }}" | |
| - "{{ ansible_env.HOME }}" | |
| - "{{ dev_scripts_path if dev_scripts_path.startswith('/') else ansible_env.HOME ~ '/' ~ dev_scripts_path }}" |
🤖 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 `@deploy/openshift-clusters/roles/dev-scripts/install-dev/tasks/create.yml`
around lines 26 - 27, `dev_scripts_path` is being used directly as an ACL target
even though its default value is relative, so the path may not resolve to the
actual directory under `ansible_env.HOME`. Update the ACL setup in `create.yml`
to normalize `dev_scripts_path` before passing it to the ACL task, using the
same resolved path consistently with `ansible_env.HOME` and the
`dev_scripts_path` variable so the QEMU process gets the intended permissions.
The ACL task hardcoded /root, but dev-scripts is deployed under /home/ec2-user. QEMU needs rx on the actual home directory to traverse the path to the agent ISO. Fixes openshift-eng#85 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ab556ec to
18dd4ae
Compare
Summary
create.ymlhardcoded/root, but dev-scripts is deployed under/home/ec2-userrxon the actual home directory to traverse the path to the agent ISO/rootwith{{ ansible_env.HOME }}and{{ dev_scripts_path }}agentmethod installs (task haswhen: method == "agent")fencing-ipi,arbiter-ipi) are unaffected — this task is skipped entirelyFixes #85
Test plan
method=agentand verify QEMU starts VMs without permission errorsmethod=ipiand verify no regression🤖 Generated with Claude Code
Summary by CodeRabbit
qemuuser the requiredrxaccess to the correct home-based directories.