Class InventoryParser
java.lang.Object
com.scivicslab.turingworkflow.plugins.inventory.InventoryParser
Parser for Ansible inventory files in INI format.
This parser supports a subset of Ansible inventory file format. Turing-workflow supports both Ansible-compatible syntax (ansible_*) and native syntax (actoriac_*).
Supported Features
- Groups:
[groupname] - Group variables:
[groupname:vars] - Global variables:
[all:vars] - Host-specific variables:
hostname key=value - Comments: lines starting with
#or;
Supported Variables
| Turing-workflow | Ansible | Description |
|---|---|---|
| actoriac_host | ansible_host | Actual hostname/IP to connect |
| actoriac_user | ansible_user | SSH username |
| actoriac_port | ansible_port | SSH port |
| actoriac_connection | ansible_connection | Connection type (ssh/local) |
Unsupported Ansible Features
The following Ansible features are NOT supported and will generate warnings:
- Children groups:
[group:children] - Range patterns:
web[01:50].example.com - Privilege escalation:
ansible_become,ansible_become_user - Python interpreter:
ansible_python_interpreter
- Since:
- 1.0
- Author:
- devteam@scivicslab.com
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a parsed Ansible inventory.static classResult of parsing an inventory file. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InventoryParser.ParseResultparse(InputStream input) Parses an Ansible inventory file.
-
Constructor Details
-
InventoryParser
public InventoryParser()
-
-
Method Details
-
parse
Parses an Ansible inventory file.This method collects warnings for unsupported Ansible features. Warnings are stored in the returned
InventoryParser.ParseResultand should be logged by the caller using the appropriate logging mechanism.- Parameters:
input- the input stream of the inventory file- Returns:
- the parse result containing inventory and any warnings
- Throws:
IOException- if reading the file fails
-