$ show sous-chefs/apt
This Chef cookbook provides custom resources for managing APT (Advanced Package Tool) configuration on Debian-family Linux distributions (Debian 12+, Ubuntu 22.04+). It is a resource-first cookbook, meaning it does not ship recipes or attribute-driven configuration; instead, users declare resources like `apt_config`, `apt_cacher_client`, `apt_cacher_ng`, and `apt_unattended_upgrades` in their wrapper cookbooks. The cookbook handles base APT update behavior, dpkg options, proxy configuration for apt-cacher clients, installation and configuration of the apt-cacher-ng caching proxy server, and unattended-upgrades setup including debconf preseeding. It relies on Chef Infra Client >= 15.3 and the underlying APT system; no external cookbook dependencies are required. The architecture is a set of Chef custom resources (in `resources/`) backed by ERB templates (in `templates/`) and a small library module (in `libraries/`). Each resource encapsulates idempotent actions: creating or deleting configuration files, installing or removing packages, and managing services. The cookbook includes comprehensive ChefSpec unit tests and InSpec integration tests, with CI/CD via GitHub Actions and Test Kitchen with Dokken. It follows modern Chef patterns (unified_mode, action_class, lazy property defaults) and is actively maintained by the Sous Chefs community. Key entry points are the four custom resources. Typical data flows: a user declares a resource in a recipe; Chef converges by writing templates to `/etc/apt/apt.conf.d/`, installing packages (e.g., `apt-cacher-ng`, `unattended-upgrades`), and managing services. The `apt_config` resource also sets up periodic `apt_update` runs and creates helper directories for preseeding. The cookbook does not expose any API endpoints or CLI tools; it is purely a configuration management library for Chef.
The LLM identified 1 files worth highlighting for reuse:
Provides the `Apt::Helpers` module with three methods: `apt_installed?` (checks if apt-get is available), `apt_which` (locates an executable in PATH), and `apt_codename` (retrieves the distribution codename from node attributes). These methods are self-contained, reusable across Chef cookbooks that need to detect APT availability or determine the codename, and demonstrate a clean pattern for encapsulating platform-specific logic.