cf_version_between

Table of Contents

Prototype: cf_version_between(string, string)

Return type: boolean

Description: Returns true if local CFEngine version is between the first string and the second string. This function is inclusive.

Arguments:

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

Example:

bundle agent __main__
{
  reports:
    "This will be skipped on versions outside this inclusive range"
      if => cf_version_between("3.15", "4");
    "This will be skipped if version is within this inclusive range"
      unless => cf_version_between("3.15", "4");
}

Output:

R: This will be skipped on versions outside this inclusive range

See also: cf_version_maximum(), cf_version_minimum(), cf_version_after(), cf_version_before(), cf_version_at().

History:

  • Introduced in 3.16.0