condition_once
Create a new condition only once.
⚙️ Compatible targets: Linux
Parameters
Name | Documentation |
---|---|
condition | The condition to define. This parameter is required. |
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