Skip to main content

A tool for efficiently exploring the hosts, groups and variables in an Ansible inventory

Project description

Inventory Explorer

Inventory Explorer helps you efficiently explore the hosts, groups and variables in an Ansible inventory.

Illustrated inventory-explorer interactions

Features:

  • Fuzzy search hosts and groups (using fzf)
  • Quickly see what groups a host is in
  • Quickly see what hosts are in a group
  • Quickly jump between related hosts and groups
  • Display and fuzzy search YAML group and host data
  • Quickly edit host or group variables
  • See fully evaluated variables (e.g. with all template substitutions applied)

Warning: Experimental

This project is currently in an experimental/exploratory phase to try and understand how an Inventory exploring tool might function and be used. It may change radically or become abandoned depending on feedback.

Installation

Install from PyPI using pip:

$ pip install inventory-explorer

Usage

$ inventory-explorer

Or

$ inventory-explorer -i path/to/inventory

Follow the prompts! Press ctrl+C to exit, or return to earlier parts of the UI. You may need to press this multiple times to exit.

Inventory aliases

In some cases it can be helpful to define short-forms for the full path(s) to a given inventory which you frequently use.

On startup, inventory-explorer tries to read the file inventory-explorer-aliases.yml from the working directory. This should be a YAML file with values in one of the three forms demonstrated below:

simple: path/to/some/simple/inventory.py

several:
  - paths/to/one/inventory.py
  - paths/to/another/inventory.ini

vars_too:
  inventory_files:
    - path/to/an/inventory.yml
  extra_vars:
    - foo=bar
    - @path/to/vars.yml

--inventory simple becomes a shorthand for --inventory path/to/some/simple/inventory.py.

--inventory several becomes a shorthand for --inventory paths/to/one/inventory.py --inventory paths/to/another/inventory.ini.

--inventory vars_too becomes a shorthand for --inventory path/to/an/inventory.py --extra-vars foo=bar --extra-vars @path/to/vars.yml.

As with the --extra-vars argument, inventory-explorer extends the Ansible syntax for extra variables by supporting shell-style glob patterns in filenames.

Development

You can run the test suite using:

$ pip install -r requirements-test.txt
$ pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inventory_explorer-0.0.1.tar.gz (25.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inventory_explorer-0.0.1-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file inventory_explorer-0.0.1.tar.gz.

File metadata

  • Download URL: inventory_explorer-0.0.1.tar.gz
  • Upload date:
  • Size: 25.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for inventory_explorer-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8d1d4b36da58f6a77b5f3b4dbb0adc477a403117c8dc605c9056ccde1c5907a8
MD5 7fb5f0b8c4659e402f8571a4bd8240f8
BLAKE2b-256 54359cd6d0308b8296c599cef2b19c44d14a6432bdeffa61798e98bcd964d439

See more details on using hashes here.

Provenance

The following attestation bundles were made for inventory_explorer-0.0.1.tar.gz:

Publisher: release.yml on bbc/inventory_explorer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file inventory_explorer-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for inventory_explorer-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1c1083565ade8166a2460c6e68bec7d9de9eb0e50e30d169a0a783bf902c063c
MD5 c787e1b723b683ffb4dca28271e262a5
BLAKE2b-256 0e925592a2cbefbe13e83a897465a7c90031abc91f643002028d6189e56a80db

See more details on using hashes here.

Provenance

The following attestation bundles were made for inventory_explorer-0.0.1-py3-none-any.whl:

Publisher: release.yml on bbc/inventory_explorer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page