The AWX CLI supports multiple configuration methods including command-line flags, environment variables, and configuration files. This guide covers all available configuration options.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ansible/awx/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
The AWX CLI requires authentication to interact with AWX or Ansible Automation Platform instances. There are several methods to provide credentials.Command-Line Authentication
Provide credentials directly with each command:Environment Variables
Set environment variables for persistent authentication:For backward compatibility,
TOWER_HOST, TOWER_USERNAME, and TOWER_PASSWORD are also supported but deprecated.Credential Files
The CLI can load credentials from a configuration file. Create a credentials file:Authentication Methods
Session-Based Authentication (Default)
By default, the CLI uses session-based authentication, which is more efficient for multiple commands:~/.awx/sessions/ and automatically managed.
Basic Authentication
For environments like AAP Gateway where session login is restricted, force Basic authentication:Connection Settings
Host Configuration
Specify the AWX/AAP host URL:https://127.0.0.1:443
SSL Certificate Verification
By default, SSL certificates are verified. For self-signed certificates or testing:API Base Path
For Red Hat Ansible Automation Platform 2.5+, set the API base path:/api/
Output Formatting
Format Options
The CLI supports multiple output formats: JSON (default)Filter Output
Use the--filter flag to select specific fields:
Color Output
Control colored output:Verbose Output
Enable debug logging to see HTTP requests:Configuration Priority
When multiple configuration sources are present, they are evaluated in this order (highest to lowest priority):- Command-line flags (
--conf.*) - Environment variables (
CONTROLLER_*) - Credential files (
AWXKIT_CREDENTIAL_FILE) - Default values
Complete Configuration Example
Create a comprehensive shell configuration:Verify Configuration
To verify your current configuration:- Base URL
- Session authentication status
- Current credentials (username only, not password)
Environment Variable Reference
| Variable | Description | Default |
|---|---|---|
CONTROLLER_HOST | AWX/AAP host URL | https://127.0.0.1:443 |
CONTROLLER_USERNAME | Authentication username | admin |
CONTROLLER_PASSWORD | Authentication password | password |
CONTROLLER_VERIFY_SSL | Enable SSL verification | true |
CONTROLLER_FORMAT | Output format (json/yaml/human/jq) | json |
CONTROLLER_COLOR | Enable colored output | true |
CONTROLLER_VERBOSE | Enable debug logging | false |
AWXKIT_API_BASE_PATH | API base path | /api/ |
AWXKIT_CREDENTIAL_FILE | Path to credentials file | None |
AWXKIT_FORCE_BASIC_AUTH | Force Basic authentication | false |
Command-Line Flag Reference
| Flag | Environment Variable | Description |
|---|---|---|
--conf.host | CONTROLLER_HOST | AWX/AAP host URL |
--conf.username | CONTROLLER_USERNAME | Username for authentication |
--conf.password | CONTROLLER_PASSWORD | Password for authentication |
-k, --conf.insecure | CONTROLLER_VERIFY_SSL | Allow insecure SSL connections |
-f, --conf.format | CONTROLLER_FORMAT | Output format |
--filter | - | Output field filter |
--conf.color | CONTROLLER_COLOR | Enable/disable colors |
-v, --verbose | CONTROLLER_VERBOSE | Enable verbose logging |
--version | - | Show CLI version |
--help | - | Show help message |
Troubleshooting
Connection Errors
Error: Connection refusedAuthentication Errors
Error: Unauthorized (401)AAP 2.5+ Path Issues
Error: Unable to fetch /api/v2/Security Best Practices
- Never commit credentials to version control
- Use environment variables instead of command-line flags in scripts (flags may appear in process lists)
- Restrict credential file permissions:
chmod 600 ~/.awx/credentials.yml - Use separate credentials for automation vs. interactive use
- Enable SSL verification in production environments
- Rotate passwords regularly
- Use RBAC to limit CLI user permissions to only what’s needed