Operators for use in auto-enroll rules

You can use the following operators to write selectors for auto-enroll rules.

Comparison operators

Comparison operators are binary operators that take the following form:

{expression 1} {operator} {expression 2}

Table 1. Comparison operators
Operator Alternative spellings Description

=

==, EQ, eq

Tests if the property value is equal to the provided value.

!=

NE, ne

Tests if the property value is not equal to the provided value.

<=

LE, le

Tests if the property value is less than or equal to the provided value.

<

LT, lt

Tests if the property value is less than the provided value.

>=

GE, ge

Tests if the property value is greater than or equal to the provided value.

>

GT, gt

Tests if the property value is greater than the provided value.

LIKE

like

Tests if the property value matches a wildcard expression.

REGEX

regex

Tests if the property value matches a Rust-style regular expression.

Logical operators

Logical operators can be unary or binary.

Table 2. Logical operators
Operator Alternative spellings Description

NOT

Inverts (negates) the operators or expressions. Examples:

NOT property = value which is equal to property != value or NOT (property = value)

property NOT LIKE value

AND

&&, &

Pairs of sub-expressions connected using this operator must both evaluate to true for the full expression to be true.

OR

||, |

At least one of the sub-expressions connected using this operator must evaluate to true for the full expression to be true.

IN

The expression is true if the property is equal to one of a list of values. Example: hostname IN rhel01, rhel02, rhel03 or hostname IN (rhel01, rhel02, rhel03)

IS

Checks the property for existence or presence of value:

EMPTY

If the property is empty.

NONE

True if the property doesn’t exist. You can use existence checks only for optional properties.

NULL

Alternative spelling for NONE.

SOME

True if the property exists. You can use existence checks only for optional properties.

Examples:

enroll-time IS NONE

enroll-time IS SOME

HAS

True if the property exists. Example: HAS enroll-time. Equivalent to enroll-time IS SOME or NOT (enroll-time is NONE)