vrops-inventory-claude

Generate Ansible-compatible YAML inventory from VMware vROps (Aria Operations).

Views0
PublishedJan 14, 2026

Loading actions...

5 minBeginnerpromptSingle file

Skill content

Main instructions and any bundled files for this skill.

markdown

vrops-inventory-claude

Generate Ansible-compatible YAML inventory from VMware vROps (Aria Operations).

Features

  • Query vROps REST API for infrastructure resources
  • Discover vSphere clusters, NSX-T edge nodes, and NSX-T managers
  • Generate Ansible YAML inventory with proper grouping
  • Support for both username/password and API token authentication
  • Configurable via environment variables or YAML config file

Installation

# Clone the repository
git clone https://gitlab.com/your-username/vrops-inventory-claude.git
cd vrops-inventory-claude

# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate

# Install the package
pip install -e .

# Or install dependencies only
pip install -r requirements.txt

Configuration

Option 1: Environment Variables

Copy .env.example to .env and configure:

cp .env.example .env
# Edit .env with your vROps credentials

Environment variables:

VariableDescriptionDefault
VROPS_HOSTvROps hostname or IP(required)
VROPS_PORTvROps API port443
VROPS_VERIFY_SSLVerify SSL certificatesfalse
VROPS_USERNAMEvROps username(required if no token)
VROPS_PASSWORDvROps password(required if no token)
VROPS_AUTH_SOURCEAuth source (local, vcenter)local
VROPS_API_TOKENAPI token (overrides user/pass)(optional)
INVENTORY_OUTPUT_PATHOutput file pathinventory.yaml

Option 2: YAML Configuration File

Copy config/config.yaml.example to config/config.yaml and configure:

cp config/config.yaml.example config/config.yaml
# Edit config/config.yaml with your settings

Usage

Generate Inventory

# Using environment variables
vrops-inventory generate

# Using config file
vrops-inventory generate -c config/config.yaml

# Custom output path
vrops-inventory generate -o my-inventory.yaml

# With verbose output
vrops-inventory generate -v

# Enrich with additional properties (slower)
vrops-inventory generate --enrich

List Resources

# List all resources
vrops-inventory list

# List specific resource types
vrops-inventory list --type clusters
vrops-inventory list --type edges
vrops-inventory list --type managers

Run as Module

python -m vrops_inventory generate -v

Output Format

The generated inventory follows Ansible YAML inventory format:

all:
  children:
    vsphere_clusters:
      hosts:
        cluster_01:
          vrops_resource_id: "abc123"
          vrops_resource_kind: "ClusterComputeResource"
          vrops_display_name: "Cluster-01"
          vrops_status: "POWERED_ON"
    nsx_edge_nodes:
      hosts:
        edge_01:
          vrops_resource_id: "def456"
          vrops_resource_kind: "NSXTEdge"
          vrops_display_name: "Edge-01"
    nsx_managers:
      hosts:
        nsx_mgr_01:
          vrops_resource_id: "ghi789"
          vrops_resource_kind: "NSXTManager"
          vrops_display_name: "NSX-Mgr-01"

Using with Ansible

# Test the inventory
ansible-inventory -i inventory.yaml --list

# Run a playbook
ansible-playbook -i inventory.yaml playbook.yaml

Development

# Install dev dependencies
pip install -e ".[dev]"

# Run linting
ruff check src/

# Run type checking
mypy src/

# Run tests
pytest

License

MIT

Share: