Table of Contents

This function is only available in CFEngine Enterprise.

Prototype: remoteclassesmatching(regex, server, encrypt, prefix)

Return type: boolean

Description: Reads persistent classes matching regular expression regex from a remote CFEngine server server and adds them into local context with prefix prefix.

The return value is true (sets the class) if communication with the server was successful and classes were populated in the current bundle.

This function contacts a remote cf-serverd and requests access to defined persistent classes on that system. Access must be granted by making an access promise with resource_type set to context.


  • regex: regular expression - Regular expression - in the range: .*
  • server: string - Server name or address - in the range: .*
  • encrypt: - Use encryption - one of
    • true
    • false
    • yes
    • no
    • on
    • off
  • prefix: string - Return class prefix - in the range: [a-zA-Z0-9_$(){}\[\].:]+


   "succeeded" expression => remoteclassesmatching("regex","server","yes","myprefix");

Notes: Note that this function assumes that you have already performed a successful key exchange between systems, (e.g. using either a remote copy or cf-runagent connection). It contains no mechanism for trust establishment and will fail if there is no trust relationship pre-established.

See also: hubknowledge(), remotescalar(), hostswithclass()