class

Krikri::BasePlugin

Inherits Krikri::PluginHelpers::StrictBoolValidation < Reference < Object

Base class for all plugins

Constructors

new(config : JSON::Any)
Source

Instance methods

config
Source
config=(config : JSON::Any)
Source
diff_mode=(diff_mode : Bool)
Source
diff_mode?
Source
execute

Abstract method - must be implemented by subclasses

Source
explicit_null_param?(key : String) : Bool
Source
finalize_result(result : PluginResult) : PluginResult

Last chance for a plugin to add the result keys Ansible's controller appends after the module's own dict - today only community.postgresql's deprecated-alias warnings (PluginHelpers::PostgresqlDeprecations). Wraps #execute rather than living inside it so EVERY exit path gets them, the early argument-validation failures included, exactly as Ansible's AnsibleModule does (its collected deprecations ride along with the fail_json exit too). Default: no change.

Source
host
Source
host=(host : Host)
Source
non_string_member_list(key : String) : Array(JSON::Any) | Nil

The decoded members of a param the parser comma-joined from a YAML list with at least one marked non-string member (see the @non_string_member_lists comment), or nil.

Source
non_string_param(key : String) : JSON::Any | Nil

The native YAML value (JSON::Any) a param carried as a non-string scalar literal, or nil when it is a string/templated value - the plugin-side view of the parser's NON_STRING_PARAM_PREFIX marker, for mirroring real action plugins' Python type checking (copy/fetch/ template dest/src).

Source
params
Source
params=(params : Hash(String, String))
Source
run

Run the plugin and output JSON result

Source
run_and_capture

Same as #run, but returns the JSON result as a String instead of printing it - the piece #run itself needs, and also what the persistent daemon dispatch (SUGGESTED_PERFORMANCE_IMPROVEMENTS.md item #15 - see plugin_daemon.cr) needs: a daemon serves many requests over one long-lived process, so it can never rely on #run's "print to the real STDOUT" behavior - each response has to be framed and written by the daemon loop itself, not by the plugin. Behavior-preserving split: #run is now a one-line wrapper around this, so every existing one-shot call site (every plugin's own driver trailer) is unaffected.

Source
vars
Source
vars=(vars : Hash(String, JSON::Any))
Source