run_task
Execute an Ansible task from a template with optional 30-second startup monitoring. Supports overrides for limit, inventory, environment, dry-run, and diff.
Instructions
Run a task from a template with optional 30-second monitoring.
Args: template_id: ID of the template to run project_id: Optional project ID (if not provided, will attempt to determine from template) environment: Optional environment variables for the task as dictionary limit: Restrict execution to specific hosts/groups (Ansible --limit) dry_run: Run without making changes (Ansible --check) diff: Show differences when changing files (Ansible --diff) debug: Enable verbose debug output playbook: Override playbook file path git_branch: Override git branch to use message: Task description/message arguments: Additional CLI arguments inventory_id: Override inventory to use follow: Enable 30-second monitoring for startup verification (default: False)
Returns: Task execution result with immediate web URLs and optional monitoring summary
Template Override Requirements: Some parameters require the template to have overrides enabled in task_params. Use create_template() or update_template() with task_params to enable:
- limit: requires task_params={"allow_override_limit": true}
- inventory_id: requires task_params={"allow_override_inventory": true}
Without these settings, the parameter will be ignored silently.Examples: # Just start the task and get URLs result = await run_task(template_id=5)
# Start task with 30-second monitoring and get URLs
result = await run_task(template_id=5, follow=True)
# Run with limit to specific hosts (template must allow override)
result = await run_task(template_id=5, limit="webservers")
# Dry run with diff to preview changes
result = await run_task(template_id=5, dry_run=True, diff=True)Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template_id | Yes | ||
| project_id | No | ||
| environment | No | ||
| limit | No | ||
| dry_run | No | ||
| diff | No | ||
| debug | No | ||
| playbook | No | ||
| git_branch | No | ||
| message | No | ||
| arguments | No | ||
| inventory_id | No | ||
| follow | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||