ansible_inventory
List Ansible inventory hosts and groups from a specified inventory file or host list. Optionally includes host variable keys.
Instructions
List Ansible inventory hosts and groups using the ansible-inventory CLI.
Args: inventory: Optional inventory path or host list (e.g., 'hosts.ini' or 'localhost,'). include_hostvars: If true, include hostvars keys in the response (not the full values). cwd: Optional working directory to run the command in. Returns: Dict with keys: ok, rc, hosts, groups, hostvars_keys (optional), command, stderr
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | ||
| env | No | ||
| inventory | No | ||
| include_hostvars | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||