stop¶
Stop playbook execution conditionally or unconditionally.
Usage Examples¶
Unconditional Stop
actions:
- command:
command: "whoami"
capture:
variable: current_user
- stop:
description: "Stop here for debugging"
Conditional Stop
actions:
- command:
command: "whoami"
capture:
variable: current_user
- stop:
condition:
variable: current_user
is_empty: true
description: "Stop if username capture failed"
Numeric Comparison
actions:
- command:
command: "echo '150'"
capture:
variable: count
parser: "int(output.strip())"
- stop:
condition:
variable: count
greater_than: 100
description: "Stop if count exceeds threshold"
Parameters¶
Parameter |
Type |
Description |
|---|---|---|
|
VariableCondition |
Condition for stopping (optional - without it, always stops) |
|
string |
Human-readable description (optional) |
Condition Operators¶
equals: Direct equality (case-sensitive)contains: Substring matchmatches: Regex pattern matchgreater_than: Numeric comparison (>)less_than: Numeric comparison (<)is_empty: Check if variable is None/empty
Notes¶
Without a condition, stop always executes
When condition is true, playbook execution halts immediately
Exactly one operator must be specified per condition
Conditions evaluated on host machine
See Also¶
continue for skipping current iteration
command for capturing values to test
Advanced Playbook Patterns for complex patterns