class

Krikri::ActionResult

Inherits Reference < Object

Result from action plugin execution

Constructors

failure(error_message : String) : ActionResult

Create failure result

Source
final(result : JSON::Any) : ActionResult

Create a final, controller-computed result - no module ever runs.

Source
new(success : Bool, modified_params : Hash(String, String) | Nil = nil, error_message : String | Nil = nil, changed : Bool = false, final_result : JSON::Any | Nil = nil)
Source
pass_through

Create pass-through result (no modifications)

Source
success?(modified_params : Hash(String, String), changed : Bool = false) : ActionResult

Create success result

Source

Class methods

conditional_error_result_json(msg : String) : JSON::Any

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.

Source
plugin_result_json(changed : Bool, failed : Bool, msg : String, extra : Hash(String, JSON::Any) = Hash(String, JSON::Any).new) : JSON::Any

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.

Source

Instance methods

changed=(changed : Bool)
Source
changed?
Source
error_message
Source
error_message=(error_message : String | Nil)
Source
final_result

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).

Source
final_result=(final_result : JSON::Any | Nil)

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).

Source
modified_params
Source
modified_params=(modified_params : Hash(String, String) | Nil)
Source
success=(success : Bool)
Source
success?
Source