Skip to content

Fixes #36210 - Correct per-host Ansible exit status - #116

Open
jakduch wants to merge 1 commit into
theforeman:masterfrom
jakduch:fix/36210
Open

Fixes #36210 - Correct per-host Ansible exit status#116
jakduch wants to merge 1 commit into
theforeman:masterfrom
jakduch:fix/36210

Conversation

@jakduch

@jakduch jakduch commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #36210.

Ansible 2.12 can emit a global error for a missing module on one host while continuing the playbook on other hosts. The global event provisionally marks every unfinished target with exit status 4, but later successful events did not clear that status. Successful hosts were therefore reported as failed.

Allow a subsequent runner_on_ok event to clear only the provisional global error status. Actual per-host failure (2) and unreachable (1) statuses remain unchanged, and newer Ansible versions that abort the whole playbook emit no later successful host event.

Add tests for clearing status 4 while preserving a real host failure.

Testing

  • Ruby syntax checks pass
  • Added focused runner unit tests; CI runs them with the repository's supported dependency bundle

AI usage disclosure

Per the community discussion on AI policy, the issue was investigated and the changes, tests, and PR wording were prepared with the assistance of Codex 5.6 Sol High. The resulting changes were reviewed before submitting. The commit also includes an Assisted-By trailer.

Allow a successful host event to clear the provisional global error status while preserving actual host failures.

Assisted-By: Codex 5.6 Sol High
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant