Skip to content

tower/job-poll-status-map

Map of JSON response field and expected values for tower-invoke-curl polling

Defines how the tower-invoke-curl polling loop interprets the JSON response body returned by the polling endpoint (tower/job-poll-url).

The map has four required keys:

  • field: The JSON path in the polling response that holds the current job status. May be a top-level key (e.g. status) or a dot-separated nested path (e.g. summary_fields.job.status). Always a string.
  • success: Value(s) of field that indicate the job completed successfully. May be a scalar string OR an array of strings.
  • wait: Value(s) of field that indicate the job is still in progress. The poller continues looping on any of these. May be a scalar string OR an array of strings.
  • failure: Value(s) of field that indicate the job has failed. May be a scalar string OR an array of strings.

Validation at pre-flight:

  • All four keys must be present and non-empty.
  • The set of values across success, wait, and failure must be pairwise disjoint — no value may appear in more than one bucket.

Status comparisons are case-insensitive — successful and Successful match.

Single-value example (simple API)

YAML
tower/job-poll-status-map:
  field: status
  success: successful
  wait: running
  failure: failed

Multi-value example (AWX / Tower)

AWX transitions a job through several non-terminal states (pending, waiting, running) and has multiple terminal-failure states (failed, error, canceled). Use arrays to accept all of them cleanly:

YAML
tower/job-poll-status-map:
  field: status
  success:
    - successful
  wait:
    - pending
    - waiting
    - running
  failure:
    - failed
    - error
    - canceled

Nested field path

YAML
tower/job-poll-status-map:
  field: summary_fields.job.status
  success: successful
  wait: running
  failure: failed

Any value of field that does not match any entry in success, wait, or failure is treated as a terminal failure. The task prints the offending value, dumps the response body, sets tower/job-poll-state to failure, and exits with code 1.

Required when tower/job-wait-type is simple or exponential.

Objects that Reference tower/job-poll-status-map

Objects used by tower/job-poll-status-map

Not used in current content packs