mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-13 22:26:49 +00:00
Every arm64 Ubuntu CI image build failed twice on 2026-11-11 (14:11 to 14:34 and 15:58 to 16:18 UTC) with Could not resolve 'ports.ubuntu.com' (PR #1477, job 130634835861). apt-mirrors.sh rewrote only the archive.ubuntu.com and security.ubuntu.com sources to the mirror list; arm64 images point at ports.ubuntu.com/ubuntu-ports, which the archive mirrors do not carry, so ports.ubuntu.com stayed their single source. INFINITO_APT_UBUNTU_PORTS_MIRRORS now lists ports.ubuntu.com, then ftp.tu-chemnitz.de and mirrors.dotsrc.org (both official Launchpad mirrors carrying ubuntu-ports with resolute and resolute-security, in sync with ports.ubuntu.com). apt-mirrors.sh points the ports sources at that list the same way the archive sources use theirs, the image build passes the key through, and the external mirror test checks both lists for speed, freshness and officiality. 🎯 Fix: 92 % 💥 Break: 3 % 💸 Cost: – ⏱️ Time: – 🛡️ Security: 75 % 🏆 Score: 67 🚦 Gate: ⚠️ security 75 % < 100: ask the operator before the commit Security 75 % comes from Trivy DS-0002 (image user should not be root) on the root Dockerfile, present on main before this change, which touches no USER line; the finding carries no line, so security.py cannot accept it. Committed on the operator's word with that cause named. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shared Utilities (utils/)
This directory contains shared Python helpers used by custom modules and plugins.
Purpose
Use utils/ for reusable code that should not be duplicated across:
library/modules,plugins/action/,plugins/filter/,plugins/lookup/.
Typical shared utilities:
- API clients,
- validation/conversion helpers,
- path and configuration helpers,
- cross-plugin/module domain logic.
- Shared HTTP(S) connection handler for multiple modules.
- Common validation or transformation functions for user input.
- Utility functions for interacting with Docker, LDAP, etc.
- Grouped helper packages such as
utils/domains/for related domain logic.
Design Guidelines
- Keep helpers focused and composable.
- Avoid side effects during import.
- Prefer explicit function/class APIs over implicit globals.
- Keep dependencies minimal so modules/plugins stay lightweight.
Example Import
from utils.domains.primary_domain import get_primary_domain
What Does Not Belong Here
- Standalone executable modules (put in
library/). - Ansible plugin entrypoints (put in
plugins/*).
References
- Module utilities: https://docs.ansible.com/ansible/latest/dev_guide/developing_module_utilities.html
- Plugin development: https://docs.ansible.com/ansible/latest/dev_guide/developing_plugins.html