BacklogZero®

Ansible in a Minute · AAP 2.7 ·

Use a survey to set extra variables in AAP 2.7

Short answer

Use a job template survey in AAP 2.7 so launch answers become extra variables in the playbook.

Subscribe for updates

Get an email whenever we publish new guides and blog posts. Unsubscribe anytime.

By subscribing you agree we may email you about Ansible in a Minute and related Level Up Labs updates. We store your address in the same lead sheet as our contact form.

Request

Show how a survey answer named app_name is available as an extra variable.

Example

A quick heads-up: Every environment is different. Review and test this example before you run it on systems you care about.

YAML
---
- name: Print the survey extra variable
  hosts: all
  gather_facts: false
  tasks:
    - name: Print app_name
      ansible.builtin.debug:
        msg: "{{ app_name }}"

How it works

Surveys set extra variables in a question-and-answer form. The playbook reads the same variable names you set on each survey question.

When to use it

  • Passing an application name into a playbook at launch
  • Replacing free-form extra vars with validated prompts

Requirements

  • AAP: 2.7
  • A job template with a survey enabled
  • A playbook that reads the survey variable names

Validation

  • Syntax validated
  • Not execution-tested
  • Last verified 2026-09-15

Procedure

  1. Open the job template Survey tab.
  2. Confirm the answer variable name on each question.
  3. Use those names in the playbook, such as {{ app_name }}.
  4. Launch the template and complete the survey.

Result

Controller passes the answers as extra variables. The playbook can print or use them.

Reference

Related guides

Back to Ansible in a Minute

Use a survey to set extra variables in AAP 2.7 · Level Up Labs