ara
ara copied to clipboard
Resume interrupted playbooks
What is the idea ?
Consider a situation in which a playbook abruptly ends either because systemctl reboot
was invoked, a transient failure occurred, or some other process halted execution of the playbook. Starting Ansible with the a playbook ID should allow the playbook to resume (noting an interruption event) recording data where it left off.
Logic is contained in v2_playbook_on_start()
lines 268:275. If playbook_id present at start (ARA_PLAYBOOK_ID
environment variable), then use that otherwise get it from API server.
Additionally, adding a separate permission, api > playbook > can amend playbook
would be an additional permission that allows or blocks this behavior. It may be desired as well to block amending failed playbooks leaving the behavior only to incomplete/in-progress ones.
Rationale
My use case is an automated reboot to change mount options/kernel parameters that are mandatory to complete the play. Since a new ID is generated on each execution, a run generates two IDs with the first never reporting as completed.