Skip to main content
Inventories in AWX define the hosts and groups that your playbooks will target. AWX supports static inventories, smart inventories, and dynamic inventory sources.

Understanding Inventories

An Inventory in AWX contains:
  • Hosts: Individual managed nodes
  • Groups: Logical collections of hosts
  • Variables: Inventory, group, and host-level variables
  • Inventory Sources: Dynamic inventory plugins

Inventory Types

Standard Inventory

Traditional static inventory with directly managed hosts and groups

Smart Inventory

Dynamic inventory based on host filters across all inventories

Constructed Inventory

Combines multiple inventories using the constructed inventory plugin

Creating a Standard Inventory

1

Create Inventory via Web UI

  1. Navigate to Inventories in the sidebar
  2. Click Add → Add inventory
  3. Fill in the details:
    • Name: Inventory name
    • Organization: Select organization
    • Instance Groups: Optional instance groups
    • Variables: Inventory-level variables in YAML/JSON
  4. Click Save
2

Create Inventory via API

3

Create Inventory via Ansible

Managing Hosts

Adding Hosts

  1. Navigate to your inventory
  2. Click the Hosts tab
  3. Click Add
  4. Enter host details:
    • Name: Hostname or IP address
    • Description: Optional description
    • Variables: Host-specific variables
  5. Click Save

Bulk Host Management

Host Variables

Common host variables:

Managing Groups

Creating Groups

  1. Navigate to your inventory
  2. Click the Groups tab
  3. Click Add
  4. Enter group name and variables
  5. Click Save

Adding Hosts to Groups

Nested Groups

Create parent-child group relationships:
Resulting structure:

Dynamic Inventory Sources

AWX supports various cloud and infrastructure providers as dynamic inventory sources:

Supported Sources

  • Amazon EC2
  • Google Compute Engine
  • Microsoft Azure
  • VMware vCenter
  • OpenStack
  • Red Hat Satellite
  • Red Hat Insights
  • ServiceNow
  • SCM (Git-based inventory)
  • Custom scripts
  • And many more via inventory plugins

Creating an AWS EC2 Inventory Source

1

Create AWS Credential

2

Create Inventory Source

3

Sync Inventory Source

SCM-Based Inventory

Use inventory files from Git repositories:

Custom Inventory Scripts

Custom inventory scripts are deprecated. Use inventory plugins instead where possible.
For custom sources, use the constructed source type with source_vars defining your logic.

Smart Inventories

Smart inventories dynamically group hosts based on filters:

Creating a Smart Inventory

Host Filter Examples

Constructed Inventories

Constructed inventories parse multiple source inventories:
The constructed inventory source is automatically created and can be configured:

Inventory Variables Hierarchy

Variables are resolved in this order (later takes precedence):
  1. Inventory variables
  2. Group variables (parent groups first)
  3. Host variables
  4. Extra variables (from job launch)
Example:

Limiting Job Execution

Limit jobs to specific hosts or groups:
Launch with custom limit:

Limit Patterns

Inventory Sync Scheduling

Schedule automatic inventory source updates:

Instance Groups

Assign instance groups to control where jobs run:

Inventory Permissions

Grant access to inventories:
Inventory roles:
  • Admin: Full control
  • Use: Use in job templates
  • Adhoc: Run ad-hoc commands
  • Update: Sync inventory sources
  • Read: View-only access

Viewing Inventory Data

Get Inventory Script Output

Output:

List Hosts

Troubleshooting

Check:
  • Credentials are valid and have necessary permissions
  • Network connectivity to the source (cloud provider, vCenter, etc.)
  • Source configuration (regions, filters) is correct
  • Review sync job output:
Common issues:
  • Overwrite settings: Check overwrite and overwrite_vars settings
  • Filters: Verify source filters aren’t excluding hosts
  • Enabled state: Check if enabled_var and enabled_value are correct
Test the inventory plugin locally:
Variables not applying as expected:
  1. Check variable precedence: inventory → group → host → extra_vars
  2. Use ansible-inventory to debug:
  • Verify filter syntax: use field lookups like groups__name for relationships
  • Test filter in the API:
  • Common filter fields: name, groups__name, inventory, custom variables

Best Practices

Use Dynamic Sources

Prefer dynamic inventory sources over manual host management for cloud environments

Organize with Groups

Use groups to organize hosts logically and share variables

Leverage Smart Inventories

Create smart inventories for cross-inventory queries and automation

Schedule Syncs

Set up scheduled syncs for dynamic sources to keep inventory current

Running Jobs

Execute playbooks against your inventories

Inventory API

Complete API reference for inventories

Credentials

Configure credentials for inventory sources

Organizations

Organize inventories within organizations