condition_once

Create a new condition only once.

⚙️ Compatible targets: Linux

Parameters

NameDocumentation
conditionThe condition to define.

This parameter is required.

Outcome conditions

You need to replace ${condition} with its actual canonified value.

  • ✅ Ok: condition_once_${condition}_ok
    • ☑️ Already compliant: condition_once_${condition}_kept
    • 🟨 Repaired: condition_once_${condition}_repaired
  • ❌ Error: condition_once_${condition}_error

Example

method: condition_once
params:
  condition: VALUE

Documentation

This method define a condition named from the parameter Condition when it is called for the first time. Following agent execution will not define the condition.

This allows executing actions only once on a given machine. The created condition is global to the agent.

In case of reinstallation or factory-reset of the Rudder agent, this method will no longer detect if the condition has already been defined.

Example:

If you use:

condition_once("my_condition")

The first agent run will have the condition my_condition defined, contrary to subsequent runs for which no condition will be defined.

See also : command_execution_once