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 - Lower CFEngine version number to compare against - in the range: .*
  • string: string - Upper CFEngine version number to compare against - in the range: .*

Example:

code
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:

code
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