Prompts
Prompts are predefined flags and options specific to each template type that you can enable to allow runtime customization. Unlike Survey Variables which are custom fields you create, prompts are built-in options that correspond to specific CLI flags for Ansible, Terraform, and other tools.
This feature allows you to:
- Override template defaults at runtime
- Target specific hosts or resources
- Control execution behavior with CLI flags
- Pass runtime options via API calls or schedules
Prompts vs. Survey Variables
| Feature | Prompts | Survey Variables |
|---|---|---|
| Definition | Predefined template-specific options | Custom fields you create |
| Examples | Ansible: --limit, --tagsTerraform: workspaces, -destroy | Environment name, version number, custom parameters |
| Configuration | Enable via checkboxes in template | Add in template settings with name and type |
| Passed as | Built-in CLI flags | Ansible: --extra-varsTerraform: -var |
Prompts are standardized options built into Semaphore for specific tools, while Survey Variables are flexible custom fields you define yourself.
Ansible Prompts
For Ansible playbook templates, you can enable prompts for the following CLI options:
Limit
Enable the --limit prompt to specify which hosts to target when running the playbook.
CLI equivalent: ansible-playbook playbook.yml --limit webservers
Use cases:
- Run playbook on a subset of inventory hosts
- Target specific servers for deployment
- Test changes on a single host before rolling out
Example:
- Your inventory contains 50 web servers
- Enable the Limit prompt
- When running the task, specify
web-01.example.comto target only that server - Or specify
webservers:&productionto target production web servers
Tags
Enable the --tags prompt to run only tasks with specific tags.
CLI equivalent: ansible-playbook playbook.yml --tags deploy,restart
Use cases:
- Execute only specific parts of a playbook
- Run deployment steps without configuration tasks
- Quickly restart services without full playbook execution
Example:
---
- hosts: all
tasks:
- name: Install packages
apt:
name: nginx
tags: install
- name: Deploy application
copy:
src: app.tar.gz
dest: /opt/app/
tags: deploy
- name: Restart service
service:
name: nginx
state: restarted
tags: restart
Enable the Tags prompt and enter deploy,restart to skip the installation step.
Skip Tags
Enable the --skip-tags prompt to skip tasks with specific tags.
CLI equivalent: ansible-playbook playbook.yml --skip-tags testing,debug
Use cases:
- Skip optional tasks in production
- Exclude debug or testing tasks
- Bypass time-consuming tasks when not needed
Example: Using the playbook above, enable Skip Tags and enter install to skip package installation and only run deployment and restart tasks.
Enabling Ansible Prompts
To enable Ansible prompts:
- Go to Task Templates and select your Ansible template
- Look for the Ansible Prompts section in template settings
- Enable checkboxes for the prompts you want:
- ☐ Limit - Enable
--limitflag - ☐ Tags - Enable
--tagsflag - ☐ Skip Tags - Enable
--skip-tagsflag
- ☐ Limit - Enable
- Save the template

When enabled, these fields appear in the task run form, API requests, and schedule configurations.
Terraform/OpenTofu Prompts
For Terraform and OpenTofu templates, Semaphore provides several built-in prompts:
Workspace Selection
Select which Terraform workspace to use for the task execution.
CLI equivalent: terraform workspace select staging
Use cases:
- Manage multiple environments (dev, staging, production)
- Separate state files for different configurations
- Test infrastructure changes in isolation
Setup:
- Create workspaces in the template's Workspaces tab
- The workspace selector automatically appears in the task form
- Users choose the target workspace when running tasks
See Terraform Workspaces for detailed setup.
Destroy Flag
Enable the -destroy flag to tear down infrastructure.
CLI equivalent: terraform apply -destroy
Use cases:
- Clean up temporary test environments
- Decommission infrastructure
- Remove specific resources
Important: This is a destructive operation. Use with caution and consider requiring confirmation in your workflows.
Migrate State Flag
Enable the -migrate-state flag when changing backend configuration.
CLI equivalent: terraform init -migrate-state
Use cases:
- Move state to a different backend
- Migrate between storage locations
- Update backend configuration