Skip to content

Inventories and hosts

An inventory lists the hosts Ansible may manage, sorts them into groups and attaches variables. Bash and Terraform templates do not use inventories.

Liftway supports three sources:

Source You edit it in Refreshed by Typical use
Manual The console (hosts, groups, variables) Saving Small or stable estates, labs
Project (Git) A static YAML or INI file in a synced project Sync Inventories reviewed in Git
Workflow-built Nowhere — generated per run A Build inventory step Hosts that Terraform just created

Groups in one picture

all
└── prod                 child groups: web, database
    ├── web              member hosts: web-01, web-02
    │   ├── web-01       ansible_host: 192.0.2.11
    │   └── web-02       ansible_host: 192.0.2.12
    └── database
        └── db-01        ansible_host: 192.0.2.21
  • A host name is Ansible's alias for the machine. The address goes in the ansible_host variable.
  • A group's member hosts belong to it directly.
  • A group's child groups pass their members up: prod contains everything in web and database. This is membership, not execution order.
  • all and ungrouped are Ansible's built-in groups; you cannot create them yourself.

Manual inventory

Inventories → Add inventory, source Manual. The editor has three tabs.

  1. Hosts — add web-01 with host variable ansible_host: 192.0.2.11, then web-02 and db-01.
  2. Groups — add web with member hosts web-01, web-02; database with db-01; prod with child groups web and database.
  3. Inventory variables — values for every host, for example ansible_user: automation.

Variable values can be plain text or JSON for numbers, booleans, lists and objects.

Liftway checks that host and group names are unique, that groups only reference existing hosts and groups, and that the group tree has no cycles (prod → web → prod is rejected). Group names must start with a letter or underscore and contain only letters, digits, _ and -.

Limits: up to 10,000 hosts, 1,000 groups and 1 MB of generated YAML per inventory.

No secrets in variables

Inventory variables are stored in PostgreSQL and copied into every run snapshot. Put passwords and keys in credentials. For become passwords, use a credential that injects ansible_become_password.

Git inventory

  1. Commit a static inventory, for example inventories/production.yml:

    all:
      vars:
        ansible_user: automation
      children:
        prod:
          children:
            web:
              hosts:
                web-01: {ansible_host: 192.0.2.11}
                web-02: {ansible_host: 192.0.2.12}
              vars:
                http_port: 8080
            database:
              hosts:
                db-01: {ansible_host: 192.0.2.21}
    
  2. Sync the project so Liftway knows the file exists.

  3. Inventories → Add inventory, source Project, choose the project and the relative path. Save.
  4. Press Sync on the inventory.

Inventory sync first checks out the project's pinned commit, reads the file (up to 1 MB) with Ansible's YAML or INI parser and stores the result. Hosts, groups and variables then appear read-only in the editor; change them in Git and sync again. The sync summary reports Hosts: 41 → 43 | +2 added | -0 removed | 1 updated.

What is not supported: dynamic inventory scripts and plugins are never executed, and group_vars/ / host_vars/ directories next to the inventory file are not imported — the runner receives the imported content as a single file. group_vars/ and host_vars/ next to the playbook still work as normal Ansible behaviour, so that is the place for per-group variable files.

A launch uses the content from the last successful inventory sync and records its commit. A failed or missing sync blocks launches that need it. To always deploy to the latest hosts, add a Sync Inventory step before the job in a workflow, or schedule the sync.

Which hosts does a run touch?

hosts in the selected inventory  ∩  the play's "hosts:" pattern  ∩  Limit (if set)

Limit can only narrow the set. With the tree above:

Play hosts: Limit Hosts touched
web — web-01, web-02
web web-01 web-01
all web web-01, web-02
prod database db-01
web database none — the run reports no hosts matched

Limit takes any Ansible host pattern: web-01, web:&eu, web:!web-02. Start new automation with a single test host in Limit, then widen it.

Variable precedence inside an inventory

From weakest to strongest: inventory variables (all), parent group variables, child group variables, host variables. Ansible's own rules still apply above that — play variables, role variables and extra variables (which always win). Avoid setting the same variable in two sibling groups; Ansible resolves the tie by group name order.

Hosts page

Hosts is a read-only catalogue of every host in every inventory, with search across host, inventory and group names and pages of 10, 25, 50 or 100. Click a host to see:

  • its explicit ansible_host address;
  • the groups it belongs to, including groups inherited through children;
  • declared variables grouped by source (inventory, each group, host).

Values whose names look sensitive — password, passwd, passphrase, token, secret, private_key, credential, ssh_pass, become_pass — and values that look like private keys or Vault ciphertext are masked. Jinja expressions are shown as written, not evaluated, and the page does not claim to reproduce Ansible's full precedence at run time.

Host counts on the dashboard are unique host names per inventory: the same name in two inventories counts twice. Host ranges like web-[01:20] are expanded. Inventories whose count is unknown (never synced, failed, unsupported format) are flagged rather than counted as zero.

Ask for the inventory at launch

Leave a template's inventory empty to make it ask at launch. The launch dialog — or the API's inventory_id — then supplies it, and the choice is recorded in the run snapshot without changing the template. Scheduled launches need a default inventory.

Inventories built from Terraform

In a workflow, a Build inventory step converts the runway_hosts output of a Terraform step into an inventory for the Ansible steps after it. See Terraform → From Terraform outputs to Ansible inventory.

Delete an inventory

An inventory cannot be deleted while a template or a workflow Sync Inventory step refers to it.