feat: Added support for debian 13 [WIP]#598
feat: Added support for debian 13 [WIP]#598denvolj wants to merge 2 commits intolinux-system-roles:mainfrom
Conversation
Reviewer's GuideAdds Debian 13 support for blivet by introducing a Debian-specific package list, configuring an external blivet repository on Debian systems, and hardening the service filtering logic used for cryptsetup-related services. Flow diagram for Debian-specific blivet repo and package installationflowchart TD
A[start_ansible_role] --> B{ansible_facts_os_family == Debian}
B -- yes --> C[add_repo_key_with_wget
store_in_/etc/apt/trusted.gpg.d/home_vtrefny.asc]
C --> D[add_blivet_repo_with_apt_repository
repo_deb_http://download.opensuse.org/repositories/home:/vtrefny/Debian_Unstable/]
B -- no --> E[skip_repo_configuration]
D --> F[ensure_blivet_is_available
install_blivet_package_list]
E --> F
F --> G[collect_ansible_facts_services]
G --> H[filter_services
selectattr_name_defined]
H --> I[filter_services
selectattr_status_defined]
I --> J[reject_services
status_match_not-found]
J --> K[reject_services
status_match_masked]
K --> L[reject_services
status_match_failed]
L --> M[set_storage_cryptsetup_services]
M --> N[end_role_execution]
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
wgetcommand used to add the repo key is not idempotent and bypasses Ansible’s package/key management, consider switching toansible.builtin.get_url(or a dedicated key-management approach) with appropriatecreates/changed_whento keep the task idempotent and easier to maintain. - The blivet
apt_repositorydefinition hardcodes the Debian_Unstable URL and does not use the distribution codename or HTTPS; consider parameterizing the repo URL based onansible_distribution_releaseand using HTTPS for better correctness and security.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `wget` command used to add the repo key is not idempotent and bypasses Ansible’s package/key management, consider switching to `ansible.builtin.get_url` (or a dedicated key-management approach) with appropriate `creates`/`changed_when` to keep the task idempotent and easier to maintain.
- The blivet `apt_repository` definition hardcodes the Debian_Unstable URL and does not use the distribution codename or HTTPS; consider parameterizing the repo URL based on `ansible_distribution_release` and using HTTPS for better correctness and security.
## Individual Comments
### Comment 1
<location path="tasks/main-blivet.yml" line_range="11" />
<code_context>
+
+ - name: Add blivet repo
+ ansible.builtin.apt_repository:
+ repo: "deb http://download.opensuse.org/repositories/home:/vtrefny/Debian_Unstable/ /"
+ state: present
+
</code_context>
<issue_to_address>
**🚨 issue (security):** Prefer HTTPS over HTTP for the external APT repository URL.
Using plain HTTP for package retrieval allows potential man-in-the-middle tampering with packages and metadata. If supported by this OpenSUSE repo (it usually is), please switch the URL to `https://download.opensuse.org/...` for safer package installation.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
tasks/main-blivet.yml
Outdated
| when: ansible_facts['os_family'] == "Debian" | ||
| block: | ||
| - name: Add repo key | ||
| ansible.builtin.command: |
There was a problem hiding this comment.
Can you use the uri module instead? https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/uri_module.html
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #598 +/- ##
==========================================
- Coverage 16.54% 10.33% -6.22%
==========================================
Files 2 8 +6
Lines 284 2023 +1739
Branches 79 0 -79
==========================================
+ Hits 47 209 +162
- Misses 237 1814 +1577
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
[citest] |
|
lgtm - @vojtechtrefny ? |
|
Got a problem after reboot -- system freeze. I'll try solve this tomorrow |
Enhancement: Added support for Debian 13
Summary by Sourcery
Add Debian 13-specific support and adjust blivet setup for Debian systems.
New Features:
Bug Fixes:
Enhancements: