Understanding Surveys
A Survey is a set of questions presented to users before launching a job. Survey responses are:- Passed as extra variables to the playbook
- Validated according to defined rules
- Stored with job history
- Can be required or optional
- Support multiple input types
Use Cases
Application Deployment
Prompt for version, environment, branch
Server Provisioning
Collect hostname, IP, region, size
User Management
Ask for username, email, groups
Configuration Changes
Request service name, port, protocol
Survey Question Types
- Text
- Password
- Integer
- Float
- Multiple Choice
- Multi-Select
Free-form text inputBest for: Names, URLs, paths
Creating a Survey
Create the Survey Specification
A survey specification is a JSON object with name, description, and spec (array of questions):
Add Survey to Job Template
- Web UI
- API
- Ansible
- Navigate to your job template
- Click the Survey tab
- Click Add
- For each question:
- Select question type
- Fill in question details
- Set variable name
- Configure validation
- Click Save
- Toggle Survey Enabled
Survey Validation
Text Validation
Integer Validation
Float Validation
Multiple Choice Validation
The selected value must be one of the defined choices
Multi-Select Validation
Using Survey Variables in Playbooks
Survey responses are available as extra variables:Advanced Survey Examples
Complete Deployment Survey
Server Provisioning Survey
Survey Best Practices
Clear Questions
Use descriptive question names and helpful descriptions
Sensible Defaults
Provide safe default values for optional fields
Appropriate Types
Use multiple choice for limited options instead of text
Validation Rules
Set min/max constraints to prevent invalid input
Combining with Extra Variables
Survey variables can be combined with job template extra_vars:Survey variables override job template extra_vars if there are conflicts.
Managing Surveys
View Survey Specification
Update Survey
Delete Survey
Enable/Disable Survey
Workflow Surveys
Workflows can also have surveys:Troubleshooting
Survey not appearing when launching
Survey not appearing when launching
Verify:
- Survey is enabled:
survey_enabled: true - Survey spec is not empty
- At least one question is defined
Validation errors on launch
Validation errors on launch
Common issues:
- Value outside min/max range
- Required field not provided
- Choice not in defined list
- Wrong data type (string vs integer)
Variables not available in playbook
Variables not available in playbook
Check:
- Variable name in survey matches playbook usage
- Survey is enabled
- Launch included survey responses
Multi-select not working
Multi-select not working
For multi-select:
- Use array in launch:
["option1", "option2"] - Default uses newline:
"option1\noption2" - In playbook, access as list:
{{ components }}
Survey vs Ask on Launch
Comparison:| Feature | Survey | Ask on Launch |
|---|---|---|
| User Interface | Custom form | Standard fields |
| Validation | Custom rules | Basic validation |
| Variable Names | Custom names | Predefined (inventory, limit, etc.) |
| Use Case | Custom application variables | Job template settings |
Related Resources
Job Templates
Create job templates that use surveys
Workflows
Add surveys to workflow templates
Extra Variables
Learn about variable precedence
Job Launch API
API reference for launching jobs with surveys