usemodule

Table of Contents

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, in the range: .*
  • args: string, in the range: .*

Example:

bundle agent test
{
  classes:

      # returns $(user)

      "done" expression => usemodule("getusers","");

  commands:

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