Skip to content

Job templates

A job template saves everything needed to run one task again and again. Launch it on its own, put it in a workflow, or run it on a schedule.

Every template has an execution type. The type decides which fields apply; Liftway rejects fields that do not belong to it.

Field Ansible Bash Terraform
Project required — required
Playbook / script / path playbook from the project script relative directory
Inventory yes, or ask at launch — —
Credentials any runtime environment only environment only
Execution environment any any Kubernetes only
Extra variables extra vars JSON file *.tfvars.json
Check mode, limit, tags, verbosity yes — —
Privilege escalation yes — —
Survey yes yes yes
Timeout 10–3600 s, default 300 same same, per phase

Common fields

Name (1–100 characters) and description (up to 1,000). Organisation is an optional label. Timeout applies to the automation itself; Kubernetes adds 60 seconds for pod start and Vault login, after which the Job is stopped.

Extra variables is a JSON object of non-secret values. They are visible in the run's Info tab and stored with every run — use credentials for secrets.

Ansible

Field Notes
Project Must be synced; the playbook list comes from its catalogue
Playbook Relative path inside the project
Inventory Default inventory; leave empty to ask at launch
Job type Run, or Check (Ansible check mode — support depends on each module)
Limit Host pattern that narrows the inventory, e.g. web-01 or web:&eu
Tags / Skip tags Comma-separated Ansible tags
Verbosity 0–4 (-v to -vvvv)
Privilege escalation become with method sudo, su or doas and a become user (default root)

For a become password, create a credential type with a secret field targeting the extra variable ansible_become_password, and attach it.

Before running the playbook, the runner installs collections from the project's collections/requirements.yml if the file exists — see Projects.

Ask at launch

Under Launch options an Ansible template can let the person launching it override Limit, Tags, Skip tags and Verbosity. Only these four fields can be overridden, and only on templates that allow it. The values are stored in the run snapshot; the template itself does not change.

The inventory is "asked at launch" by leaving it empty, as described in Inventories.

Bash

The script (up to 100,000 characters) runs inside the runner, not on inventory hosts, as:

bash --noprofile --norc -eo pipefail
  • A failing command or pipeline stage fails the job; the exit code decides the result.
  • Extra variables are written as JSON to a temporary file; its path is in $RUNWAY_EXTRA_VARS_FILE:

    release=$(jq -r .release "$RUNWAY_EXTRA_VARS_FILE")   # needs jq in the image
    
  • Credentials arrive as environment variables. Controller tokens, database settings and shell start-up hooks such as BASH_ENV are not passed in.

  • On timeout or cancel, Liftway terminates the whole process group, including child processes.
  • Output streams live; exact secret values are replaced by [REDACTED].

Terraform

Field Notes
Project Synced project containing the Terraform code and its .terraform.lock.hcl
Path Directory inside the project, . for the root
Command Validate, or Plan → Review → Apply
State Liftway managed state (recommended) or External backend
Workspace Stable state identity; defaults to the template ID

Extra variables become a variables.tfvars.json file passed with -var-file. Credentials must target environment variables, e.g. HCLOUD_TOKEN or AWS_ACCESS_KEY_ID. With managed state, Liftway sets the TF_HTTP_* backend variables itself and rejects credentials that try to set them.

Terraform runs only in a Kubernetes execution environment. The full flow — review, approval, state and outputs — is described in Terraform plan, review, apply.

Surveys

The Survey tab asks for values at launch and turns the answers into extra variables. Up to 50 questions per template.

Question type Answer Bounds apply to
Text single line length
Textarea multi-line text length
Integer whole number value
Decimal number value
Choice one of the listed choices —
Multiple choice a list of listed choices number of items

Each question has a variable name, label, description, a required flag and an optional default. Answers override the template's extra variables of the same name.

  • Scheduled launches use the defaults; a required question without a valid default makes the scheduled launch fail validation.
  • In workflows, answers are collected per step at launch.
  • Answers are ordinary, visible job variables. Do not ask for passwords in a survey.

Launch a template

Launch opens a dialog for the inventory (if asked), survey answers and launch options, then starts a run and opens its page. The run is listed under Jobs.

Through the API:

POST /api/templates/{id}/launch
Content-Type: application/json

{
  "inventory_id": "…",
  "extra_vars": {"release": "2026.11.23"},
  "survey_answers": {"region": "fsn1"},
  "overrides": {"limit": "web-01", "verbosity": 2}
}

All four keys are optional. Unknown keys are rejected. The response is 202 Accepted with the new run.

What gets checked when you save

  • The project is synced and the playbook exists in its catalogue.
  • Inventory, credentials and execution environment exist.
  • Credentials are runtime credentials, at most 20, no duplicates; Bash and Terraform only take environment-variable credentials.
  • Ansible-only fields are not set on Bash or Terraform templates.

Delete a template

A template cannot be deleted while a workflow step uses it. Past runs keep their snapshots.