Class InventoryParser

java.lang.Object
com.scivicslab.turingworkflow.plugins.inventory.InventoryParser

public class InventoryParser extends Object
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

Supported inventory variables
Turing-workflowAnsibleDescription
actoriac_hostansible_hostActual hostname/IP to connect
actoriac_useransible_userSSH username
actoriac_portansible_portSSH port
actoriac_connectionansible_connectionConnection 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
  • Constructor Details

    • InventoryParser

      public InventoryParser()
  • Method Details

    • parse

      public static InventoryParser.ParseResult parse(InputStream input) throws IOException
      Parses an Ansible inventory file.

      This method collects warnings for unsupported Ansible features. Warnings are stored in the returned InventoryParser.ParseResult and 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