cloudera.exe.version test – compare Cloudera version strings

Note

This test plugin is part of the cloudera.exe collection (version 3.0.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install cloudera.exe..

To use it in a playbook, specify: cloudera.exe.version.

New in cloudera.exe 3.0.0

Synopsis

  • Compare version strings using the Cloudera versioning scheme.

  • Cloudera versioning is an extension of Semantic Versioning that uses the prerelease segment to indicate service packs or extended patch releases.

  • Moreover, this versioning scheme allow the prerelease delimiter to use whitespace (' ') and dots ('.') in addition to the semantic version’s dash ('-').

Input

This describes the input of the test, the value before is cloudera.exe.version or is not cloudera.exe.version.

Parameter

Comments

Input

string / required

Left hand version to compare

Keyword parameters

This describes keyword parameters of the test. These are the values key1=value1, key2=value2 and so on in the following examples: input is cloudera.exe.version(key1=value1, key2=value2, ...) and input is not cloudera.exe.version(key1=value1, key2=value2, ...)

Parameter

Comments

operator

string

Comparison operator

Choices:

  • "=="

  • "="

  • "eq" ← (default)

  • "<"

  • "lt"

  • "<="

  • "le"

  • ">"

  • "gt"

  • ">="

  • "ge"

  • "!="

  • "<>"

  • "ne"

version

string / required

Right hand version to compare

Examples

- name: Cloudera version test examples
  assert:
    that:
      - "'7.3.1' is version('8.0.0', 'lt')"
      - "'7.1.9 SP3' is version('7.1.9', 'gt')"
      - "'7.1.9 SP3' is version('7.1.9 SP2', 'gt')"

Return Value

Key

Description

Return value

boolean

Returns True or False depending on the outcome of the comparison.

Returned: success

Authors

  • Cloudera Labs

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.