Introduction
ansible-navigator is a text-based user interface (TUI) for running and developing Ansible content. It replaces ansible-playbook, ansible-doc, ansible-inventory, and ansible-config with a single tool that runs playbooks inside Execution Environments (container images) — the same way Automation Controller runs them. This means what works in your terminal works identically in production.
Install
# pip (recommended)
pip install ansible-navigator
# RHEL/CentOS
sudo dnf install ansible-navigator
# Ubuntu/Debian
pip install ansible-navigator
# Verify
ansible-navigator --version
Requirements
- Python 3.10+
- Container runtime:
podman(preferred) ordocker - An Execution Environment image (or uses
ansible-navigatordefault EE)
Quick Start
# Run a playbook (interactive TUI)
ansible-navigator run site.yml
# Run a playbook (traditional stdout)
ansible-navigator run site.yml --mode stdout
# Explore collections in the default EE
ansible-navigator collections
# Browse module docs
ansible-navigator doc ansible.builtin.copy
# View your inventory
ansible-navigator inventory -i inventory.yml
ansible-navigator vs ansible-playbook
| Feature | ansible-playbook | ansible-navigator |
|---|---|---|
| Output | Streaming text | Interactive TUI or stdout |
| Execution | Local Python env | Inside Execution Environment |
| Replay | No | Yes — artifact JSON |
| Collection docs | Separate ansible-doc | Built-in :doc |
| Inventory explorer | Separate ansible-inventory | Built-in :inventory |
| Config viewer | Separate ansible-config | Built-in :config |
| EE support | No (manual) | Native |
| Image explorer | No | Built-in :images |
Modes
Interactive Mode (Default)
ansible-navigator run site.yml
Launches a TUI with navigable output:
- Use number keys to drill into plays, tasks, hosts
- Press
:backor Esc to go up - Press
:quitor q to exit - Type
:helpfor all commands
Stdout Mode
ansible-navigator run site.yml --mode stdout
Produces traditional ansible-playbook-style output. Use in CI/CD pipelines.
Configuration
ansible-navigator.yml
# ansible-navigator.yml (project root)
---
ansible-navigator:
execution-environment:
container-engine: podman
image: registry.redhat.io/ansible-automation-platform-25/ee-supported-rhel9:latest
pull:
policy: missing
volume-mounts:
- src: /home/user/.ssh
dest: /home/runner/.ssh
options: ro
environment-variables:
set:
ANSIBLE_FORCE_COLOR: "true"
mode: stdout
playbook-artifact:
enable: true
save-as: artifacts/{playbook_name}-{time_stamp}.json
logging:
level: warning
file: /tmp/ansible-navigator.log
ansible:
inventories:
- inventory/production.yml
config: ansible.cfg
Configuration Precedence
- Command-line flags
ansible-navigator.ymlin current directory~/.ansible-navigator.yml- Built-in defaults
Running Playbooks
Basic Run
ansible-navigator run site.yml \
--inventory inventory/production.yml \
--extra-vars "env=production" \
--mode stdout
With a Custom EE
ansible-navigator run deploy.yml \
--eei my-custom-ee:latest \
--mode stdout
With Vault
ansible-navigator run site.yml \
--vault-password-file .vault_pass \
--mode stdout
Limit and Tags
ansible-navigator run site.yml \
--limit webservers \
--tags deploy,restart \
--mode stdout
Exploring Execution Environments
List Available Images
ansible-navigator images
Output shows:
- Image name and tag
- ansible-core version inside
- Python version
- Installed collections
- System packages
Inspect an EE
ansible-navigator images --eei ee-supported-rhel9:latest
Drill into:
- 0 — General info
- 1 — Ansible version and collections
- 2 — Python packages
- 3 — System packages
- 4 — Everything
Browsing Collections and Docs
List Collections in EE
ansible-navigator collections
View Module Documentation
ansible-navigator doc ansible.builtin.copy
ansible-navigator doc community.general.proxmox_kvm
ansible-navigator doc ansible.builtin.uri --type module
Interactive Doc Browsing
ansible-navigator collections
# Navigate: select collection → select plugin type → select plugin
Inventory Explorer
ansible-navigator inventory -i inventory.yml
- View groups, hosts, and variables
- Drill into specific hosts to see all vars (including group_vars, host_vars)
- Verify inventory structure before running playbooks
Replaying Artifacts
Every run produces a JSON artifact:
# Replay a previous run
ansible-navigator replay artifacts/site-2026-04-25T14:30:00.json
Navigate the replay exactly like a live run — drill into tasks, check host results, review variables. Share artifact files with teammates for debugging.
Using in CI/CD
# .github/workflows/ansible.yml
name: Run Ansible
on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install ansible-navigator
run: pip install ansible-navigator
- name: Run playbook
run: |
ansible-navigator run site.yml \
--mode stdout \
--eei ee-supported-rhel9:latest \
--inventory inventory/staging.yml \
--extra-vars "env=staging"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ansible-artifact
path: artifacts/
TUI Keyboard Shortcuts
| Key | Action |
|---|---|
| Numbers (0-9) | Select item |
:back / Esc | Go back |
:quit / q | Quit |
:help | Show help |
:stdout | View raw stdout |
:doc <module> | View module docs |
:inventory | Switch to inventory view |
:config | View ansible config |
:log | View log |
/ | Filter/search |
+ / - | Page down/up |
Troubleshooting
"Container engine not found"
# Install podman
sudo apt install podman
# or
sudo dnf install podman
# Verify
podman --version
"EE image pull failed"
# Login to registry first
podman login registry.redhat.io
# Or use a public EE
ansible-navigator run site.yml --eei quay.io/ansible/creator-ee:latest
"Playbook not found inside EE"
Volume mounts are needed — your project directory must be mounted:
# ansible-navigator.yml
ansible-navigator:
execution-environment:
volume-mounts:
- src: /path/to/project
dest: /runner/project
Falling Back to Local Execution
# Skip EE, run locally (like ansible-playbook)
ansible-navigator run site.yml --execution-environment false --mode stdout
Best Practices
- Use
ansible-navigator.ymlin every project — reproducible settings for the team - Pin EE images — use tags like
:2.16not:latest - Enable artifacts — free debugging replay for every run
- Use stdout mode in CI — interactive TUI doesn't work in pipelines
- Mount SSH keys read-only —
options: roin volume mounts - Match EEs to production — use the same image locally and in Automation Controller
- Share artifacts for debugging — teammates can replay your exact run
Related Articles
- Ansible Execution Environments
- Ansible Automation Platform 2.6 Architecture
- Ansible Playbook Guide
- Ansible Collections Guide
Conclusion
ansible-navigator is the modern replacement for ansible-playbook. It runs playbooks inside Execution Environments (matching production), provides an interactive TUI for navigating results, saves replayable artifacts, and integrates collection docs, inventory exploration, and config viewing into one tool. Use --mode stdout for CI/CD and interactive mode for development. Pin your EE image in ansible-navigator.yml for reproducible runs across your team.