module

Krikri::Oneline

The per-result rendering half of the oneline stdout callback emulation (see src/krikri/oneline_output.cr for the shape contract and the state/line-core half). Lives here because it reuses this file's ad-hoc dump machinery (adhoc_result_json's oneline branch and the clean_for_display strip are exactly what the real oneline.py callback feeds its results through).

Constants

DEPRECATION_WARNING_TEXT = "Use another callback plugin, or vendor and/or move the oneline callback to a collection."

Byte-parity with ansible-core 2.21.6: selecting the oneline callback deprecates it at load time, through the builtin runtime yml's callback.oneline.deprecation entry (removal_version 2.23 plus this warning_text) rendered by Display's plugin-info message formatter - live-captured: "<name> has been deprecated. <warning_text> This feature will be removed from ansible-core version 2.23.", where <name> is the configured value exactly as the user spelled it (short or FQCN). Behavior parity, not a krikri deprecation.

Class methods

command_module?(module_name : String | Nil) : Bool

ansible-core's C.MODULE_NO_JSON membership, by short module name (the FQCN's last segment - ansible.builtin.command and ansible.windows.win_command both qualify).

Source
command_msg(host_name : String, caption : String, result : JSON::Any) : String

The real callback's _command_generic_msg: host | caption | rc=N | (stdout) X with the escaped stdout, and (stderr) Y appended without a pipe when stderr is present and non-empty. A result with no rc renders rc=-1 (Python's result.get('rc', -1)).

Source
deprecation_text(configured_name : String) : String
Source
display_result(host : Host, result : JSON::Any, module_name : String | Nil = nil, item_label : String | Nil = nil, no_log : Bool = false) : Nil

Called from ResultDisplay.display_result's entrypoint for every non-loop-item result when enabled. Loop items (item_label set) print nothing here - the loop finisher renders the ONE aggregate line the real oneline callback emits per host.

Source
emit_startup_deprecation(configured_name : String, origin_env : String | Nil = nil) : Nil

configured_name is the value exactly as the user wrote it - both oneline and ansible.builtin.oneline name themselves in the message - and origin_env the environment variable the callback was selected from, which earns 2.21's Origin block (see emit_deprecation_with_origin). krikri's own -o / --one-line / --krikri-oneline flags have no upstream counterpart (real ansible-playbook rejects them), so they pass no origin and print the bare deprecation line.

Source
enable
Source
enabled?
Source
exception_line(exception_text : String) : String

The real callback's exception-branch line: the LAST line of the (stripped) exception text after the fixed prefix. 2.19 tags every module-failure result with an exception - (traceback unavailable) when there is no real traceback.

Source
skip_line(host_name : String, suffix : String = "") : String

Shared by every skipping: [host] print site: under oneline the whole suffix machinery collapses to the bare status line.

Source