A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.cfengine.com/latest/reference-functions-classmatch.html below:

classmatch - CFEngine 3.26 Docs

Prototype: classmatch(regex, tag1, tag2, ...)

Return type: boolean

Description: Tests whether regex matches any currently set class.

Returns true if the anchored regular expression matches any currently defined class, otherwise returns false.

You can optionally restrict the search by tags, which you can list after the regular expression.

Example:

code

body common control
{
      bundlesequence  => { "example" };
}

bundle agent example
{
  classes:

      "do_it" and => { classmatch("cfengine_3.*"), "any" };
      "have_hardclass_nonesuch" expression => classmatch("nonesuchclass_sodonttryit", hardclass);
  reports:

    do_it::

      "Host matches pattern";

    have_hardclass_nonesuch::

      "Host has that really weird hardclass";
}

Output:

code

R: Host matches pattern

See also: canonify(), classify(), classesmatching(), classes defined via augments, countclassesmatching()


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4