Prototype: usemodule(module, args)

Return type: boolean

Description: Execute CFEngine module script module with args, and return whether successful.

The module script is expected to be located in the registered modules directory, WORKDIR/modules.

Arguments:

  • module: string - Name of module command - in the range: .*
  • args: string - Argument string for the module - in the range: .*

Example:

bundle agent test
{
  classes:
    # returns $(user)
    "done" expression => usemodule("getusers", "");

  commands:
    "/bin/echo" args => "test $(user)";
}

See also: read_module_protocol(), Module Protocol