hostrange

Table of Contents

Prototype: hostrange(prefix, range)

Return type: boolean

Description: Returns whether the current host lies in the range of enumerated hostnames specified with prefix.

This is a pattern matching function for non-regular (enumerated) expressions.

Arguments:

  • prefix: string, in the range: .*
  • range: string, in the range: .*

Example:

bundle agent example
{
classes:

  "compute_nodes" expression => hostrange("cpu-","01-32");

reports:

  compute_nodes::

    "No computer is a cluster";

}