ANXS - apt
Ansible role for managing the APT package cache, cleaning up unneeded packages and .deb files, and optionally performing system upgrades with configurable frequency and style.
- Ansible 2.13 or higher.
- Ubuntu 20.04+ or Debian 11+.
Some commonly adjusted variables. See defaults/main.yml for the full set.
apt_upgrade(defaultfalse) controls whether automatic upgrades are done during the Ansible run.apt_upgrade_style(defaultsafe) controls the upgrade method. Other options arefullanddist.apt_upgrade_frequency(defaultonce) affects how often the upgrade is run. Other options arealwaysand (once per)boot.
apt_install_recommends/apt_install_suggests(both default tofalse) allow installing recommended or suggested packages.apt_autoremove(defaulttrue) for removing packages that are no longer needed/apt_cache_valid_time(default3600) to control how often APT cache is refreshed.
Tests use Molecule with Docker and Testinfra. Run the full suite with make test, or target a specific platform (e.g. make test-ubuntu2404). A comprehensive matrix covering upgrade style and frequency combinations is available via make test-matrix.
The test suite verifies APT configuration, required package installation, cache validity, upgrade execution and log parsing, lock file behavior across frequency modes, and OS-specific log format handling. Tests run across all supported Linux distributions.
This project has been developed with AI assistance. Contributions making use of AI generated content are welcome, however they must be human reviewed prior to submission as pull requests, or issues. All contributors must be able to fully explain and defend any AI generated code, documentation, issues, or tests they submit. Contributions making use of AI must have this explicitly declared in the pull request or issue. This also applies to utilization of AI for reviewing of pull requests.
Are welcome!