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

condition

VariableCondition

Condition for stopping (optional - without it, always stops)

description

string

Human-readable description (optional)

Condition Operators

  • equals: Direct equality (case-sensitive)

  • contains: Substring match

  • matches: Regex pattern match

  • greater_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