ansible-task
Run an Ansible task ad-hoc against specified hosts with optional become, check mode, and extra variables.
Instructions
Run a single Ansible task ad-hoc
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"task": "<task>"
},
"name": "ansible-task"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | Ansible task to run (module and args) | |
| hosts | No | Target hosts | localhost |
| inventory | No | Path to inventory file | |
| become | No | Use sudo/become | |
| extraVars | No | Extra variables | |
| check | No | Run in check mode | |
| verbose | No | Enable verbose output |