Krikri::ActionResult
Result from action plugin execution
Constructors
Create a final, controller-computed result - no module ever runs.
Class methods
The result shape for a CONDITIONAL-EVALUATION failure (assert:'s
that: hitting an undefined reference or a non-bool result) - the
conditional failed before any module ran, and real Ansible's
registered var for this shape carries ONLY failed+msg, with no
changed key at all (live-verified against ansible-core 2.19:
assert: that: undef_var == 1 with register: gives
keys=['failed', 'msg']; a later task reading <reg>.changed sees
it as undefined and fails its own templating, while an ordinary
failing assertion still registers changed: false alongside).
plugin_result_json can't express the missing key, so this builds
the hash directly. The when:/ path's identical shape lives in
Executor's when_error_result/swallow_when_error.
Shared builder for the flat result hash PluginResult#to_json produces (changed/failed/msg + extra fields at the top level, no nesting) - used by every final-result action plugin (action_plugins/*.cr) so each one only needs to name its own extra fields, not re-derive this shape.
Instance methods
Set only by an action plugin that computes the task's ENTIRE result on the controller and needs no module invocation at all (debug:/ assert:/fail:/set_fact:/pause: - see their own action-plugin files under action_plugins/). When present, the caller (prepare_batch_step / execute_task_once / the handler path) skips plugin upload/dispatch entirely and uses this JSON as the task's result verbatim (still passed through apply_changed_failed_when, same as any other result) - distinct from modified_params, which still expects a real module (local or remote) to run afterward with the substituted params (template:'s own use).
Set only by an action plugin that computes the task's ENTIRE result on the controller and needs no module invocation at all (debug:/ assert:/fail:/set_fact:/pause: - see their own action-plugin files under action_plugins/). When present, the caller (prepare_batch_step / execute_task_once / the handler path) skips plugin upload/dispatch entirely and uses this JSON as the task's result verbatim (still passed through apply_changed_failed_when, same as any other result) - distinct from modified_params, which still expects a real module (local or remote) to run afterward with the substituted params (template:'s own use).