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
- Navigate to Inventories in the sidebar
- Click Add → Add inventory
- Fill in the details:
- Name: Inventory name
- Organization: Select organization
- Instance Groups: Optional instance groups
- Variables: Inventory-level variables in YAML/JSON
- Click Save
2
Create Inventory via API
3
Create Inventory via Ansible
Managing Hosts
Adding Hosts
- Web UI
- API
- Ansible
- Navigate to your inventory
- Click the Hosts tab
- Click Add
- Enter host details:
- Name: Hostname or IP address
- Description: Optional description
- Variables: Host-specific variables
- Click Save
Bulk Host Management
Host Variables
Common host variables:Managing Groups
Creating Groups
- Web UI
- API
- Ansible
- Navigate to your inventory
- Click the Groups tab
- Click Add
- Enter group name and variables
- Click Save
Adding Hosts to Groups
Nested Groups
Create parent-child group relationships: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
For custom sources, use theconstructed 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:Inventory Variables Hierarchy
Variables are resolved in this order (later takes precedence):- Inventory variables
- Group variables (parent groups first)
- Host variables
- Extra variables (from job launch)
Limiting Job Execution
Limit jobs to specific hosts or groups: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:- 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
List Hosts
Troubleshooting
Inventory source sync fails
Inventory source sync fails
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:
Hosts not appearing after sync
Hosts not appearing after sync
Common issues:
- Overwrite settings: Check
overwriteandoverwrite_varssettings - Filters: Verify source filters aren’t excluding hosts
- Enabled state: Check if
enabled_varandenabled_valueare correct
Variable precedence issues
Variable precedence issues
Variables not applying as expected:
- Check variable precedence: inventory → group → host → extra_vars
- Use
ansible-inventoryto debug:
Smart inventory filter not working
Smart inventory filter not working
- Verify filter syntax: use field lookups like
groups__namefor 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
Related Resources
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