usemodule

Prototype: usemodule(name, args)

Return type: class

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

Arguments:

  • name : Name of module command, in the range .*

The name of the module without its leading path, since it is assumed to be in the registered modules directory, WORKDIR/modules.

  • args : 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)";
}