Files
computer-playbook/utils
kevinveenbirkenbachandClaude Opus 5 cdf5db4c1f feat(diagnostics): collect module, device and network counters
Two investigations of run 30781723102 stalled on files the rescue capture does
not take.

The zfs question - why the debian lab nodes cannot use a module their ubuntu
counterparts apply on ten nodes - needed /proc/modules to see whether the module
is loaded, /proc/misc to see whether it registered (a misc device never appears
in /proc/devices, which is what docker_dataroot.sh was searching), `ls -l
/dev/zfs` to tell a real node from the static one every privileged container
inherits, and `zfs version` for the libzfs version a whole refuted hypothesis
turned on.

The matrix-mdad question - whether ~31.8s per git clone is a connect stall or a
server-side queue - needs the TCP retransmission counters in /proc/net/snmp and
/proc/net/netstat and the conntrack drop counters. Neither can be distinguished
from per-clone timings alone.

Executed on a host with no zfs: a missing binary and a missing proc file each
land as text in the artifact rather than aborting the capture, which is the
best-effort contract run() already implements.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-03 18:00:42 +02:00
..
…
…
…
…

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