Skip to content

external

!external

Category: commands

Run an external (user-supplied) program module on the target. The module binary is uploaded and invoked with the JSON params piped to stdin; it must emit a YAML/JSON map on stdout.

Notes

  • chdir follows the same absolute target-path rules as !command and !shell. It applies only to the module invocation; uploads, staging, and cleanup retain their usual directory. Directory entry happens inside the sudo context and failures cannot be suppressed by failed_when.

Parameters

NameTypeRequiredDescription
usestringyesName/path of the external module program to locate and upload.
paramsmapyesFree-form parameter map, serialized to JSON and fed to the module stdin.
chdirpathnoAbsolute working directory on the execution target (templated). Omission preserves the target’s default directory.
savestringnoVariable name to save the parsed response map (always includes rc).
failed_whenconditionnoExpression overriding fail-when-rc-nonzero.
changed_whenconditionnoExpression overriding always-changed.

Examples

- !external
  use: my_health_check
  params:
    endpoint: /api/v1/status
    timeout: 5
  save: health