Add just molecule-clean

`just molecule` leaves a shared virtualenv of over 500 MB under var/, plus a
~7 MB Ansible home per role that has a scenario. Neither is reclaimed by
anything today.

`--idle-days N` limits it to what has not been touched recently, so it can be
run unattended without taking the cache out from under a scenario being worked
on right now.

The two directories are named explicitly rather than globbed: var/ holds other
things and must never be removed wholesale.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SEH3vxYSQ5SV4N5z61eyGT
This commit is contained in:
Slavi Pantaleev
2026-08-27 18:02:53 +03:00
co-authored by Claude Opus 5
parent 6ad1c9b031
commit e2d3be504e
4 changed files with 108 additions and 0 deletions
+11
View File
@@ -90,3 +90,14 @@ own job there, so there is nothing to collide with.
The directories are disposable; `var/` is gitignored. Delete `var/molecule-ansible-home/` to force
a fresh install.
## Reclaiming the disk space
`just molecule-clean` removes what the runs leave under `var/`.
Two things live there. The per-role Ansible homes are ~7 MB each, rewritten on every run rather
than grown, so they are bounded by the number of roles that have a scenario. The shared virtualenv
is the bulk of it, over 500 MB, and is recreated on the next run at the cost of a `pip install`.
`--idle-days N` restricts it to what has not been touched in N days, which is what makes it safe to
run unattended. `--yes` skips the confirmation.