Skip to main content

45 Days to RHCE - ansible-navigator

· loading · loading ·
Table of Contents
45 Days to RHCE - This article is part of a series.
Part 4: This Article

Really short post this week! Had no motivation to study with a cold..

Learned some ansible-navigator stuff. It’s a pretty neat tool. I like seeing all of a host’s our group’s variables from there.

Sign up free to receive updates on this series!

Ansible Navigator`
#

ansible-navigator setup
#

Register subscription manager

subscription-manager register

Show available subscriptions

subscription-manager list --available

Scroll down and copy the pool id:

Attach to the subscription:

subscription-manager attach --pool=2c94b9169c25391b019c690720d56541

Show repos and grab the most recent one:

subscription-manager repos --list | grep ansible

Install the most recent repo from above (not the source or debug):

subscription-manager repos --enable ansible-automation-platform-2.6-for-rhel-9-x86_64-rpms

Install necessary packages:

dnf -y install ansible-navigator ansible-core rhel-system-roles vim

Log in to redhat’s podman registry to be able to pull EE containers:

podman login registry.redhat.io

Using ansible-navigator
#

View subcommands

ansible-navigator --help

Run:

ansible-navigator

Grab additional ees:

podman pull quay.io/ansible/creator-ee

ansible-navigator will detect the above automatically.

Use : to run the listed commands.

esc to go back.

Generate config file, use tmp first so ansible-navigato doesn’t try to read the file immediately:

ansible-navigator settings --gs --pp never --dc false > tmp
mv tmp ansible-navigator.yml

Or you can make it available while in any directory for your user:

mv ansible-navigator.yml ~/.ansible-navigator.yml

Uncomment:

  execution-environment:

  pull:
  
  policy: tag

Change policy to only pull ee image if it’s missing, this will make it much faster to open ansible-navigator:

      policy: missing

You can also change the default ee from this file:

#     # Specify the name of the execution environment image
#     image: quay.io/organization/custom-ee:latest

You can override this when calling from the command line:

ansible-navigator collections --eei ee-supported-rhel8

Using ansible-navigator
#

There is no man page for ansible-navigator!

Run a playbook with output on terminal:

ansible-navigator run -m stdout playbook.yml

The application runs in the ee container, which is running as the root inside the container.

You can use all the same options for ansible-playbook when you use ansible-navigator run.

By default, ansible-navigator leaves playbook artifacts that log how the playbook run went.

# ls
anaconda-ks.cfg
ansible-navigator.log
simple-artifact-2026-02-18T12:01:26.604766+00:00.json
simple-artifact-2026-02-18T12:04:22.066603+00:00.json
simple.yml

Run without generating artifacts with --pae false:

ansible-navigator run -m stdout --pae false simple.yml

Navigator will not prompt for password with -K option unless you pass the -m stdout option

Ansible-navigator inventory
#

Can view inventory and associated variables from the TUI.

View inventory as a graph: ansible-navigator inventory -m stdout --graph

ansible-navigator config
#

Shows current settings as listed in ansible.cfg

Search for a string:

:f user

Clear the search:

:f

Show config options in a pager:

ansible-navigator config -m stdout list

ansible-navigator exec
#

Navigator will bind mount the directory “collections” in the current working directory and install any collections listed there into the execution environment.

Pull up interactive shell in the execution environment:

ansible-navigator exec

ansible-navigator doc
#

Used like ansible-doc.

That’s all for this week!

45 Days to RHCE - This article is part of a series.
Part 4: This Article