Inventory

Managing groups, hosts, and variables in SculptOps’s inventory manager.

Overview

An inventory defines the servers Ansible will act on and how they are organized. SculptOps stores inventories in the database and generates the appropriate Ansible inventory file at execution time.

You can have multiple inventories per organization — for example, one for production and one for staging.

Groups

Every inventory is organized into groups. A group is a named collection of hosts. Hosts can belong to multiple groups. The special group all implicitly contains every host in the inventory.

Create a group under Infrastructure → Inventories → [your inventory] → Add group. Groups can be nested: a group can have child groups, mirroring Ansible’s native :children syntax.

Hosts

Add hosts to a group via Add host. Each host requires an ansible_host value (IP or hostname). You can optionally specify:

  • ansible_portOverride the SSH port for this host (default: 22)
  • ansible_userOverride the SSH user for this host
  • ansible_ssh_private_key_fileInjected automatically from the SSH key you select

Variables

Group variables

Set variables that apply to all hosts in a group under Group → Variables. Use YAML or JSON format. These map directly to Ansible group_vars.

yaml
# Example group vars
http_port: 80
max_connections: 512
deploy_user: deploy

Host variables

Override variables for a specific host by editing the host and opening the Variables tab. Host vars take precedence over group vars.

Import / Export

Importing

You can import an existing Ansible inventory in INI or YAML format. Go to Inventories → Import and paste or upload your inventory file. SculptOps parses it and populates groups, hosts, and variables automatically.

ini
# INI format example
[webservers]
web1 ansible_host=10.0.1.10
web2 ansible_host=10.0.1.11

[databases]
db1 ansible_host=10.0.2.10

[webservers:vars]
http_port=80
yaml
# YAML format example
all:
  children:
    webservers:
      hosts:
        web1:
          ansible_host: 10.0.1.10
        web2:
          ansible_host: 10.0.1.11
      vars:
        http_port: 80

Exporting

Export any inventory as INI or YAML from Inventories → [inventory] → Export. The exported file is compatible with the ansible-playbook -i flag if you need to run it from the CLI.

Warning
Exported inventories do not include SSH private keys. SSH key references are replaced with the key name as a comment.

Dynamic inventory

SculptOps does not currently support Ansible’s dynamic inventory scripts directly. As a workaround, you can use a webhook or schedule to call an external script that updates the inventory via the PATCH /api/inventories/:id API endpoint before each run.