| name | ansible-navigator-config |
| description | Configure ansible-navigator for optimal workflow, execution environment integration, and troubleshooting. Use this skill when the user asks to: "configure ansible-navigator", "setup navigator", "navigator config", "ansible-navigator settings", "navigator ee integration", "navigator troubleshooting", "ansible-navigator.yml", "set up ansible navigator", or wants to configure or optimize their ansible-navigator workflow. Always invoke this skill for ansible-navigator configuration and usage guidance.
|
| version | 1.0.0 |
| allowed-tools | ["Write","Read","Bash"] |
Ansible Navigator Configuration Skill
Configure ansible-navigator for optimal workflow, execution environment integration, log management, and troubleshooting.
What is ansible-navigator?
ansible-navigator is a text-based user interface (TUI) for Ansible that provides:
- Interactive playbook execution with real-time exploration
- Execution environment integration for containerized runs
- Log replay and analysis
- Collection/inventory browsing
- Enhanced debugging capabilities
- Artifact generation for CI/CD integration
Key Benefits:
- Consistent runtime environments (via EEs)
- Better visibility into playbook execution
- Improved troubleshooting workflow
- CI/CD friendly (stdout mode)
- Log replay for post-execution analysis
Installation
pip install ansible-navigator
ansible-navigator --version
pip install ansible-builder
sudo dnf install podman
sudo apt-get install docker.io
Configuration File: ansible-navigator.yml
Place in project root or home directory (~/.ansible-navigator.yml).
Basic Configuration
---
ansible-navigator:
execution-environment:
enabled: true
image: quay.io/ansible/creator-ee:latest
pull:
policy: missing
container-engine: podman
mode: interactive
playbook-artifact:
enable: true
replay: artifacts/
save-as: "{playbook_dir}/artifacts/{playbook_name}-artifact-{time_stamp}.json"
logging:
level: info
append: true
file: ansible-navigator.log
editor:
command: vim {filename}
console: true
inventories:
- inventory/production
- inventory/staging
Advanced Configuration
---
ansible-navigator:
execution-environment:
enabled: true
image: my-custom-ee:1.0.0
pull:
policy: missing
arguments:
- "--tls-verify=false"
container-engine: podman
container-options:
- "--net=host"
- "--privileged"
environment-variables:
set:
ANSIBLE_CONFIG: /runner/project/ansible.cfg
CUSTOM_VAR: value
pass:
- HTTP_PROXY
- HTTPS_PROXY
volume-mounts:
- src: /local/path
dest: /runner/local
options: Z
ansible:
config: ansible.cfg
cmdline: "--forks 15 --timeout 60"
inventories:
- inventory/
playbook-artifact:
enable: true
replay: artifacts/
save-as: "artifacts/{playbook_name}-{time_stamp}.json"
documentation:
plugin:
name: shell
type: module
collection-doc-cache-path: ~/.cache/ansible-navigator/collection_doc_cache
color:
enable: true
osc4: true
display-color:
changed: yellow
debug: dark_gray
ok: green
skip: cyan
editor:
command: code -w {filename}
console: false
format: yaml
logging:
level: debug
append: true
file: ~/.ansible-navigator.log
mode: interactive
images:
details:
- ansible_version
- python_version
- collections
time-zone: UTC
Execution Environment Integration
Using Custom EE
---
ansible-navigator:
execution-environment:
enabled: true
image: quay.io/myorg/my-custom-ee:1.0.0
pull:
policy: missing
volume-mounts:
- src: "{project_dir}"
dest: /runner/project
options: Z
- src: ~/.ssh
dest: /home/runner/.ssh
options: ro,Z
- src: /etc/ansible/inventory
dest: /runner/inventory
options: ro,Z
Environment Variables
execution-environment:
environment-variables:
set:
ANSIBLE_VAULT_PASSWORD_FILE: /runner/.vault_pass
ANSIBLE_FORCE_COLOR: "true"
CUSTOM_API_KEY: "${API_KEY}"
pass:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- HTTP_PROXY
- HTTPS_PROXY
- NO_PROXY
Without Execution Environment
For local Ansible installation:
---
ansible-navigator:
execution-environment:
enabled: false
ansible:
config: ansible.cfg
playbook: playbooks/site.yml
Mode Configuration
Interactive Mode (Development)
Best for development and troubleshooting:
ansible-navigator:
mode: interactive
editor:
command: vim {filename}
console: true
playbook-artifact:
enable: true
save-as: "artifacts/{playbook_name}-artifact.json"
Features:
- Navigate through playbook execution
- Drill into tasks, hosts, results
- Review documentation inline
- Replay from artifacts
Usage:
ansible-navigator run playbook.yml
Stdout Mode (CI/CD)
Best for automation and CI/CD:
ansible-navigator:
mode: stdout
playbook-artifact:
enable: true
save-as: "artifacts/{playbook_name}-{time_stamp}.json"
logging:
level: info
file: ansible-navigator.log
Features:
- Standard output (like ansible-playbook)
- Artifact generation for later review
- CI/CD friendly
- Non-interactive
Usage:
ansible-navigator run playbook.yml --mode stdout
Command Patterns
Running Playbooks
ansible-navigator run playbook.yml
ansible-navigator run playbook.yml --mode stdout
ansible-navigator run playbook.yml -i inventory/production
ansible-navigator run playbook.yml -e "env=production"
ansible-navigator run playbook.yml --tags install,configure
ansible-navigator run playbook.yml --check
ansible-navigator run playbook.yml \
--execution-environment-image my-ee:1.0.0
ansible-navigator replay artifacts/site-artifact-2026-04-25.json
Exploring Collections
ansible-navigator collections
ansible-navigator collections ansible.posix
ansible-navigator doc ansible.builtin.copy
ansible-navigator doc -l | grep copy
Exploring Inventory
ansible-navigator inventory
ansible-navigator inventory --host server01
ansible-navigator inventory --list
ansible-navigator inventory --graph
Exploring Images
ansible-navigator images
ansible-navigator images my-custom-ee:1.0.0
ansible-navigator images my-custom-ee:1.0.0 --details
Configuration
ansible-navigator config
ansible-navigator config dump
ansible-navigator config dump --mode stdout
Artifact Analysis
Artifacts are JSON files containing complete playbook execution details.
Artifact Structure
{
"version": "1.0",
"plays": [
{
"play": {
"name": "Configure web servers",
"id": "uuid",
"duration": {"start": "...", "end": "..."}
},
"tasks": [
{
"task": {
"name": "Install Apache",
"id": "uuid"
},
"hosts": {
"server01": {
"action": "ansible.builtin.package",
"changed": true,
"failed": false,
"result": {...}
}
}
}
]
}
]
}
Replay Artifacts
ansible-navigator replay artifacts/playbook-artifact.json
jq '.plays[0].tasks[] | select(.task.name == "Install Apache")' \
artifacts/playbook-artifact.json
jq '[.plays[].tasks[].hosts[] | select(.changed == true)] | length' \
artifacts/playbook-artifact.json
jq -r '.plays[].tasks[] | select(.hosts[].failed == true) | .task.name' \
artifacts/playbook-artifact.json
Logging and Debugging
Log Configuration
ansible-navigator:
logging:
level: debug
append: true
file: ~/.ansible-navigator/navigator.log
Log Analysis
tail -f ~/.ansible-navigator/navigator.log
grep -i error ~/.ansible-navigator/navigator.log
grep "ERROR\|CRITICAL" ~/.ansible-navigator/navigator.log
Debug Output
ansible-navigator run playbook.yml -vvv
ansible-navigator:
logging:
level: debug
ansible:
cmdline: "-vvv"
CI/CD Integration
GitHub Actions
name: Run Ansible Playbook
on:
push:
branches: [main]
jobs:
ansible:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install ansible-navigator
run: pip install ansible-navigator
- name: Run playbook
run: |
ansible-navigator run playbook.yml \
--mode stdout \
--pull-policy always \
--execution-environment-image my-ee:latest
- name: Upload artifact
uses: actions/upload-artifact@v3
if: always()
with:
name: playbook-artifact
path: artifacts/*.json
GitLab CI
ansible-playbook:
stage: deploy
image: quay.io/ansible/creator-ee:latest
script:
- pip install ansible-navigator
- |
ansible-navigator run site.yml \
--mode stdout \
--execution-environment-image ${CI_REGISTRY_IMAGE}/ansible-ee:latest \
--pull-policy always
artifacts:
paths:
- artifacts/*.json
when: always
Jenkins
pipeline {
agent any
stages {
stage('Run Ansible') {
steps {
sh '''
pip install ansible-navigator
ansible-navigator run playbook.yml \
--mode stdout \
--execution-environment-image my-ee:1.0.0
'''
}
}
}
post {
always {
archiveArtifacts artifacts: 'artifacts/*.json'
}
}
}
Troubleshooting
Common Issues
1. EE Image Not Found
Problem:
Error: image not found: my-custom-ee:1.0.0
Solutions:
execution-environment:
pull:
policy: always
execution-environment:
image: quay.io/myorg/my-custom-ee:1.0.0
podman pull my-custom-ee:1.0.0
podman images
2. Volume Mount Permission Denied
Problem:
Error: Permission denied accessing /runner/project
Solutions:
volume-mounts:
- src: "{project_dir}"
dest: /runner/project
options: Z
container-options:
- "--privileged"
3. SSH Key Access
Problem:
Error: SSH key not accessible in container
Solutions:
volume-mounts:
- src: ~/.ssh
dest: /home/runner/.ssh
options: ro,Z
environment-variables:
set:
SSH_AUTH_SOCK: /run/user/1000/ssh-agent.sock
volume-mounts:
- src: /run/user/1000/ssh-agent.sock
dest: /run/user/1000/ssh-agent.sock
4. Inventory Not Found
Problem:
Error: Unable to find inventory
Solutions:
ansible:
inventories:
- inventory/production
volume-mounts:
- src: /etc/ansible/inventory
dest: /runner/inventory
options: ro,Z
5. Collection Not Found in EE
Problem:
Error: collection not found in execution environment
Solutions:
ansible-navigator images my-ee:1.0.0 --details
execution-environment:
volume-mounts:
- src: ~/.ansible/collections
dest: /runner/collections
options: ro,Z
Project Configuration Examples
Development Setup
---
ansible-navigator:
execution-environment:
enabled: true
image: quay.io/ansible/creator-ee:latest
pull:
policy: missing
volume-mounts:
- src: "{project_dir}"
dest: /runner/project
options: Z
mode: interactive
editor:
command: code -w {filename}
console: false
playbook-artifact:
enable: true
save-as: "artifacts/{playbook_name}-artifact.json"
logging:
level: info
file: navigator.log
Production/CI Setup
---
ansible-navigator:
execution-environment:
enabled: true
image: quay.io/myorg/prod-ee:1.0.0
pull:
policy: always
environment-variables:
pass:
- VAULT_PASSWORD
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
mode: stdout
ansible:
config: ansible.cfg
cmdline: "--forks 20"
playbook-artifact:
enable: true
save-as: "artifacts/{playbook_name}-{time_stamp}.json"
logging:
level: warning
file: /var/log/ansible-navigator.log
Multi-Environment Setup
---
ansible-navigator:
execution-environment:
enabled: true
image: my-ee:${ENV_TAG:-latest}
volume-mounts:
- src: "{project_dir}"
dest: /runner/project
options: Z
- src: "inventory/${ENV:-dev}"
dest: /runner/inventory
options: ro,Z
ansible:
inventories:
- inventory/${ENV:-dev}
mode: ${NAVIGATOR_MODE:-interactive}
Usage:
ENV=dev ansible-navigator run playbook.yml
ENV=staging NAVIGATOR_MODE=stdout ansible-navigator run playbook.yml
ENV=production ENV_TAG=1.0.0 NAVIGATOR_MODE=stdout \
ansible-navigator run playbook.yml
Best Practices
1. Always Use Artifacts
playbook-artifact:
enable: true
save-as: "artifacts/{playbook_name}-{time_stamp}.json"
Benefits:
- Post-execution analysis
- Debugging failed runs
- Audit trail
- CI/CD integration
2. Pin EE Versions in Production
execution-environment:
image: my-ee:1.2.3
execution-environment:
image: my-ee:latest
3. Use Appropriate Mode
- Development:
mode: interactive
- CI/CD:
mode: stdout
- Debugging:
mode: interactive + logging.level: debug
4. Organize Artifacts
artifacts/
├── development/
├── staging/
└── production/
playbook-artifact:
save-as: "artifacts/${ENV}/{playbook_name}-{time_stamp}.json"
5. Secure Sensitive Data
environment-variables:
pass:
- VAULT_PASSWORD
- API_TOKEN
- AWS_SECRET_ACCESS_KEY
volume-mounts:
- src: ~/.vault_pass
dest: /runner/.vault_pass
options: ro,Z
Quick Reference
Common Commands
ansible-navigator run playbook.yml
ansible-navigator run playbook.yml --mode stdout
ansible-navigator replay artifacts/playbook-artifact.json
ansible-navigator collections
ansible-navigator doc ansible.builtin.copy
ansible-navigator inventory --list
ansible-navigator images my-ee:1.0.0
ansible-navigator config dump
Interactive Mode Keys
- Arrow keys: Navigate
- Number keys: Drill down (0-9)
- ESC: Go back
- : : Command mode
- :q: Quit
- :help: Show help
- :o: Open in editor
- :f: Filter
- :write: Save output
Output Template
When configuring ansible-navigator, provide:
- ansible-navigator.yml with appropriate settings
- Explanation of key configuration choices
- Usage examples for common scenarios
- Troubleshooting guidance for likely issues
- Integration examples (CI/CD if applicable)
Explain:
- Why specific settings were chosen
- How to run in different modes
- How to analyze artifacts
- How to troubleshoot common issues
- How to integrate with workflows
When asked to configure ansible-navigator, analyze requirements, generate appropriate configuration, and provide comprehensive usage and troubleshooting guidance.