The modules are idempotent and shell and command are not, so a playbook that reaches for them loses the property the tool exists for — and reports “changed”…
A one-off maintenance script usually gets written as a file and run with wp eval-file, which works until it needs to define a class or register a command…