module

Krikri::PluginHelpers::ModprobeCommand

ModprobeCommand - pure logic for building the modprobe load command line. No I/O here - the plugin itself runs the resulting command.

Class methods

load_command(bin_path : String, name : String, params : String | Nil) : String

params: (real community.general modprobe.py's own extra modprobe arguments, e.g. "numdummies=2") is appended verbatim after the module name, matching modprobe <name> <params> - verified against the real module's source: command.extend([ self.name] + shlex.split(self.params)), only ever called when the module isn't already loaded. Real modprobe.py also resolves the binary once via get_bin_path and invokes THAT path (self.modprobe_bin), so the resolved path is passed in rather than a bare "modprobe" hoping for $PATH lookup.

Source
parse_bin_probe(stdout : String) : NamedTuple(path: String | Nil, searched_paths: String)

Parses the ModprobePlugin binary-resolution probe's output (searched=/found= lines): the resolved modprobe path (nil when the binary is missing - the caller must then fail with real Ansible's get_bin_path(required=True) message BEFORE any state check, not report "already unloaded" success) and the colon-joined list of directories actually searched, for that message's "in paths: ..." tail.

Source