Skip to content

Execution model

Automax uses a fixed hierarchy:

Job
  Task[]
    Step[]
      Substep[]

Job

A job is the top-level YAML file. It declares metadata, default targets, strategy, failure policy, variables and tasks.

Task

A task groups related work. Examples:

  • install packages;
  • render configuration;
  • restart services;
  • validate health checks.

Step

A step is the SSH connection boundary. For every resolved target, Automax opens a new SSH connection for that step and runs all matching substeps through it.

Substep

A substep calls one plugin:

- id: install_nginx
  use: os.package.install
  with:
    name: nginx
    sudo: true

Flow-control substeps do not call plugins directly. if, list-style if, switch, retry, for, block, set / let, echo, assert, sleep, noop, fail, try / rescue / always, break and continue are interpreted by the engine and then execute normal nested substeps where needed. Registered plugin outputs and set / let values feed later conditions and loops through the normal Jinja context.

Substeps can register outputs for later use:

- id: read_version
  use: command.remote.run
  with:
    command: cat /opt/app/VERSION
  register:
    app_version: stdout.trim

Strategies

Supported strategies are:

strategy:
  mode: serial
strategy:
  mode: parallel
  max_parallel: 5
strategy:
  mode: rolling
  batch_size: 2
  pause_between_batches: 10

Failure policy

failurePolicy:
  onFailure: stop_job
  onUnreachable: stop_host
  maxFailedHosts: 1

Supported failure decisions are stop_job, stop_task, stop_host and continue.