How to Install Ansible on Rocky Linux 10

Install Ansible on Rocky Linux 10 using ansible-core, EPEL collection RPMs, pipx, or pip. Add ansible-navigator, Podman, verify versions, and run your first ping test.

Published

Updated

Read time 14 min read

Reviewed byDeepak Prasad

Install Ansible on Rocky Linux 10 control node with dnf, EPEL, pipx, and pip

Ansible runs on one control machine and connects to your servers over SSH. That design is agentless: managed nodes never run an Ansible daemon and usually never get ansible-core installed.

For most Rocky Linux 10 users, install Ansible with:

bash
sudo dnf install -y ansible-core

Use EPEL only when you need extra collection RPMs. Use pipx or pip only when you deliberately want a PyPI-based Ansible install.

If you are following the GoLinuxCloud Ansible course, you already have two VMs—rocky1 and rocky2—from lab setup. Both need SSH, hostnames, and the ansible user. Only rocky1 gets the packages from this guide.

IMPORTANT
Install Ansible on the control node only (rocky1 in the course lab). Do not run dnf install ansible-core on managed nodes such as rocky2. Managed hosts only need SSH, Python 3, and a user your control node can log in as—the lab setup guide already configured that.
VM Role Install from this guide?
rocky1 Control node — you run ansible and ansible-playbook here Yes
rocky2 Managed node — target for playbooks No — SSH + Python only

Without Ansible on the control node, you cannot run ansible, ansible-playbook, or ansible-navigator. Rocky Linux 10 ships ansible-core in AppStream on the machine where you work. Extra collections, navigator, and Podman are separate steps on that same host.

This page walks through four engine install paths, optional ansible-navigator and Podman, version checks, and a first ping on localhost.

Tested on: Rocky Linux 10.2 (Red Quartz); kernel 6.12.0-211.16.1.el10_2.0.1.x86_64; ansible-core 2.16.16; ansible-navigator 26.6.0; Podman 5.8.2.

NOTE
Version stamp (Rocky Linux 10.2, July 2026): AppStream ships ansible-core 2.16.x. EPEL 10 provides collection RPMs such as ansible-collection-ansible-posix 2.1.0. Package names and availability change between minor releases—always verify with dnf search ansible and dnf repolist on your host before you copy install commands from any guide.
NOTE
This chapter is part of the GoLinuxCloud Ansible tutorial (RHCE EX294). Follow along from ~/ansible-project, inventory group lab, and playbooks in playbooks/. Use your own host names and paths if yours differ.
NOTE
Pick one engine install method (dnf, pipx, or pip) and stick with it. Mixing distro ansible-core with a user-site pip install ansible-core causes confusing ansible --version output.

What Will You Install?

Component What it is Typical install source on Rocky 10
ansible-core Engine: ansible, ansible-playbook, ansible-galaxy, built-in modules AppStream (dnf), or PyPI (pip / pipx)
Ansible collections Extra modules and roles (ansible.posix, community.general, …) EPEL RPMs, or ansible-galaxy collection install
ansible-navigator Text UI for playbooks and execution environments PyPI (ansible-dev-tools or ansible-navigator[ansible-core])—no EL10 RPM
Podman Runs execution-environment container images for navigator AppStream / EPEL (dnf)

You do not need every row on day one. A common stack is ansible-core from dnf, plus navigator and Podman when you practice execution environments.


Ansible vs ansible-core vs ansible-navigator

People say install Ansible when they mean several different packages. On Rocky Linux 10 the names map to real RPMs and commands—mixing them up is how you end up running dnf install ansible on a repo set that does not provide it, getting an error, and wondering which tutorial is wrong.

The diagram below is the mental model to keep straight: one workflow name at the top, one engine in the middle, optional extras on the sides and on top.

Ansible core, collections, and ansible-navigator layers on Rocky Linux 10

Read the stack from bottom to top:

  1. Ansible (everyday term) is the automation workflow you are learning—inventory, playbooks, modules, SSH from a control node to managed hosts. When a blog says “install Ansible,” it usually means “get the engine running on the control machine.”

  2. ansible-core is that engine, packaged plainly. One dnf install ansible-core gives you /usr/bin/ansible, /usr/bin/ansible-playbook, /usr/bin/ansible-galaxy, and built-in ansible.builtin.* modules (ping, copy, service, dnf, and the rest). Everything in the wide block in the diagram depends on this package.

  3. Collections sit beside the engine—not inside ansible-core. Packages such as ansible.posix or community.general add modules and roles you install with EPEL RPMs or ansible-galaxy collection install. You add them when a playbook needs FQCNs beyond ansible.builtin.

  4. ansible-navigator is an optional layer on top, not a second engine. You still run the same playbooks and inventory; navigator adds a terminal UI, easier collection browsing, and execution environments (playbooks inside a Podman image). Rocky Linux 10 does not ship it as an RPM—you install it from PyPI after ansible-core (see optional navigator section).

Name What you get Rocky Linux 10
Ansible (everyday term) The automation workflow Learn with ansible-core + collections as needed
ansible-core CLI engine + built-in modules sudo dnf install ansible-core (AppStream)
Legacy ansible PyPI/RPM name Engine plus many bundled collections On tested Rocky 10.2 repos, dnf install ansible did not resolve; use ansible-core
ansible-navigator TUI + execution environments PyPI (ansible-dev-tools or ansible-navigator[ansible-core]); no EL10 RPM

You can run playbooks with only ansible-core and never install navigator. Some courses also use ansible-navigator, so this guide covers it as an optional step after the engine install.

For architecture (control node, managed nodes, inventory), see what is Ansible. Once the engine is installed, browse module options with ansible-doc and collections.


Which Ansible Installation Method Should You Choose?

Method Install command (summary) Best for
Method 1: dnf sudo dnf install ansible-core Recommended — distro build, SELinux-friendly deps, matches RHEL family docs
Method 2: EPEL Enable EPEL, install ansible-collection-* RPMs Adding curated collections as system packages alongside ansible-core
Method 3: pipx pipx install ansible-core Isolated engine in a venv without touching system Python
Method 4: pip pip install --user ansible or ansible-core PyPI-only labs, CI images, or when you cannot use dnf
NOTE
PyPI may provide a newer ansible-core than Rocky AppStream. That is useful for testing newer upstream features, but for RHEL/Rocky-style labs, prefer the distro package unless you intentionally need the newer version.

After the engine, use Optional: ansible-navigator and Optional: Podman when you need execution environments.


Method 1: Install ansible-core Using dnf

When to Use This Method

Use dnf when you want the Rocky Linux / AppStream build—stable dependencies, easy updates with dnf update, and the path most RHEL documentation assumes. This is the default for the GoLinuxCloud lab.

Install ansible-core

bash
sudo dnf install -y ansible-core

dnf pulls in Python helpers such as python3-jinja2 and python3-resolvelib automatically.

Verify ansible-core

bash
ansible --version

Sample output:

output
ansible [core 2.16.16]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.12/site-packages/ansible
  ansible collection location = /home/ansible/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.12.13 (main, Apr 16 2026, 00:00:00) [GCC 14.3.1 20251022 (Red Hat 14.3.1-4)] (/usr/bin/python3)
  jinja version = 3.1.6
  libyaml = True

The executable location line should show /usr/bin/ansible—that confirms you are using the distro package.


Method 2: Add Ansible Collections Using EPEL

When to Use This Method

Use EPEL when you already have ansible-core and want collection RPMs (ansible-collection-ansible-posix, ansible-collection-community-general, and others) installed as system packages.

On the tested Rocky Linux 10.2 repository set, dnf install ansible did not resolve. The reliable Rocky 10 path is dnf install ansible-core from AppStream, then add required collections from EPEL RPMs or Ansible Galaxy. Official Ansible distro docs may list an ansible package for some EPEL releases—verify with dnf search ansible on your host before you assume a metapackage is available.

Enable EPEL Repository

On EL10, enable CRB before EPEL or some packages fail dependency checks. For distribution-specific steps across RHEL, Rocky Linux, AlmaLinux, CentOS Stream, and Oracle Linux, see install EPEL on RHEL-based Linux. On minimal installs, config-manager comes from dnf-plugins-core, so install that first:

bash
sudo dnf install -y dnf-plugins-core
bash
sudo dnf config-manager --set-enabled crb
bash
sudo dnf install -y epel-release

Confirm EPEL is active:

bash
dnf repolist enabled | grep -i epel

Sample output:

output
epel                 Extra Packages for Enterprise Linux 10 - x86_64

Install collection RPMs from EPEL

Install ansible-core from AppStream first if you have not already (Method 1).

On our tested Rocky 10.2 repos, the legacy ansible metapackage name did not resolve:

bash
sudo dnf install -y ansible

Sample output:

output
No match for argument: ansible
Error: Unable to find a match: ansible

Install a collection from EPEL instead—for example ansible.posix:

bash
sudo dnf install -y ansible-collection-ansible-posix

Sample output:

output
Installed:
  ansible-collection-ansible-posix-2.1.0-1.el10_2.noarch
Complete!

Search for other collection RPMs when you need them:

bash
dnf search ansible-collection | head -8

Sample output:

output
ansible-collection-ansible-posix.noarch : Ansible posix collection
ansible-collection-ansible-utils.noarch : Ansible utils collection
ansible-collection-community-general.noarch : General Ansible collection
...

Verify Ansible

List collections Ansible can see:

bash
ansible-galaxy collection list

Sample output:

output
# /usr/share/ansible/collections/ansible_collections
Collection    Version
------------- -------
ansible.posix 2.1.0

If the table is empty, no collection RPMs are installed yet—only built-in ansible.builtin modules are available.


Method 3: Install ansible-core Using pipx

When to Use This Method

Use pipx when you want ansible-core in an isolated virtual environment—useful on shared hosts where you should not mix PyPI packages into the system Python. Do not combine this with Method 1 on the same user account unless you carefully manage PATH.

Install pipx

Enable EPEL if needed (Method 2), then:

bash
sudo dnf install -y pipx

Install ansible-core

As the user who will run Ansible:

bash
pipx ensurepath

Log out and back in, or reload your shell so ~/.local/bin is on PATH.

bash
pipx install ansible-core

Sample output:

output
creating virtual environment...
installing ansible-core...
done! ✨ 🌟 ✨
  installed package ansible-core 2.21.1, installed using Python 3.12.13
  These apps are now available
    - ansible
    - ansible-config
    - ansible-console
    - ansible-doc
    - ansible-galaxy
    - ansible-inventory
    - ansible-playbook
    - ansible-pull
    - ansible-test
    - ansible-vault

If you already installed ansible-core with dnf (Method 1), pipx may warn that /usr/bin/ansible is already on your PATH. Use either the distro binaries or the pipx ones—call ~/.local/bin/ansible explicitly, or adjust PATH order.

Verify ansible-core

Use the pipx binary directly when a distro install is also present:

bash
~/.local/bin/ansible --version

Sample output:

output
ansible [core 2.21.1]
  config file = None
  executable location = /home/ansible/.local/bin/ansible
  ...

executable location under ~/.local/bin confirms the pipx install. PyPI may ship a newer core than AppStream—that is one reason to prefer Method 1 when you want the distro version pin.


Method 4: Install Ansible Using pip

When to Use This Method

Use pip for quick experiments, containers, or when you cannot use dnf. You can install the slim ansible-core package or the full ansible PyPI package (bundles many collections—large download).

Prefer pip install --user as your automation user—not sudo pip as root.

Install Python pip

bash
sudo dnf install -y python3-pip

Install Ansible

As your automation user, install the engine only:

bash
python3 -m pip install --user 'ansible-core>=2.16'

Or install the full upstream bundle (collections included via dependencies):

bash
python3 -m pip install --user ansible

Add user binaries to your PATH if needed:

bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Verify Ansible

bash
ansible --version

Sample output (ansible-core via pip):

output
ansible [core 2.16.16]
  config file = None
  executable location = /home/ansible/.local/bin/ansible
  ...

If you installed the full ansible package, also check:

bash
ansible-community --version

This command exists only when the full PyPI ansible community package is installed. It is not expected after only dnf install ansible-core.


Optional: Install ansible-navigator

When to Install ansible-navigator

Install navigator when you need the TUI, execution environments, or your course expects ansible-navigator beside ansible-playbook. Skip it if you only run playbooks from the shell.

Rocky Linux 10 has no ansible-navigator RPM:

bash
sudo dnf install -y ansible-navigator

Sample output:

output
No match for argument: ansible-navigator
Error: Unable to find a match: ansible-navigator

Install ansible-navigator

Install Podman first if you plan to use execution environments (next section).

Upstream currently recommends installing ansible-dev-tools for a complete navigator and dev-tools stack—it bundles navigator with related packages and installs ansible-core if it is missing. For a smaller navigator-only install, use ansible-navigator[ansible-core] or install navigator after you confirm ansible-core is already available from Method 1.

If you already installed ansible-core with dnf, a PyPI stack may still pull a second engine into ~/.local/bin. Prefer one engine on your PATH, or call ~/.local/bin/ansible-navigator explicitly.

Official example — pip install ansible-dev-tools:

bash
python3 -m pip install --user ansible-dev-tools

This is equivalent to the official pip3 install ansible-dev-tools example.

Isolated option — pipx with ansible-dev-tools:

bash
pipx install ansible-dev-tools

After pipx install ansible-dev-tools, run pipx list to confirm which commands were exposed.

Smaller install — pip with navigator and core extra (when engine is not yet on PATH):

bash
python3 -m pip install --user 'ansible-navigator[ansible-core]'

Navigator only — when ansible-core is already installed:

bash
pipx install ansible-navigator

Sample output (pipx, navigator-only path tested on this lab):

output
creating virtual environment...
installing ansible-navigator...
done! ✨ 🌟 ✨
  installed package ansible-navigator 26.6.0, installed using Python 3.12.13
  These apps are now available
    - ansible-navigator

Verify ansible-navigator

bash
ansible-navigator --version

Sample output:

output
ansible-navigator 26.6.0

Optional: Install Podman for Execution Environments

Why Podman Is Needed

ansible-navigator can run playbooks inside execution environment images—containers that bundle Ansible, Python libs, and collections. On Linux, Podman is the usual runtime for those images.

Install Podman

bash
sudo dnf install -y podman

Verify Podman

bash
podman --version

Sample output:

output
podman version 5.8.2

List EE images navigator knows about (first run may pull ~1.3 GB):

bash
ansible-navigator images --mode stdout

Sample output:

output
name: community-ansible-dev-tools
  name_tag: community-ansible-dev-tools:latest (primary)
  repository: ghcr.io/ansible/community-ansible-dev-tools
  size: 1.33 GB
  tag: latest

Configure navigator defaults in ansible-navigator.yml after you create your project ansible.cfg.


Compare Installed Ansible Versions

After install, compare the tools on your PATH:

bash
ansible --version | head -1

Sample output:

output
ansible [core 2.16.16]

If you installed navigator:

bash
ansible-navigator --version

Sample output:

output
ansible-navigator 26.6.0

If you used the full PyPI ansible package (Method 4):

bash
ansible-community --version

That command exists only when the full PyPI ansible community package is installed—not after dnf install ansible-core alone.

Check which binary runs when multiple installs exist:

bash
which ansible

Sample output (dnf Method 1):

output
/usr/bin/ansible

Sample output (pip or pipx):

output
/home/ansible/.local/bin/ansible

Check Installed Ansible Collections

Built-in modules live in ansible.builtin. Extra collections come from EPEL RPMs or ansible-galaxy collection install.

bash
ansible-galaxy collection list

Sample output (after EPEL ansible.posix RPM):

output
# /usr/share/ansible/collections/ansible_collections
Collection    Version
------------- -------
ansible.posix 2.1.0

Install a collection from Ansible Galaxy when no RPM exists:

bash
ansible-galaxy collection install ansible.utils

List again to confirm:

bash
ansible-galaxy collection list

Run a Basic Local Ansible Test

Before you target remote hosts, ping localhost to confirm Python and the engine work:

bash
ansible localhost -m ansible.builtin.ping

Sample output:

output
localhost | SUCCESS => {
    "changed": false,
    "ping": "pong"
}

That is Ansible’s module check—not ICMP echo. The module name is ansible.builtin.ping.

If you completed lab setup, ping a managed host next (from a project with inventory, or with -i and -u until ansible.cfg exists):

bash
ansible rocky2 -m ansible.builtin.ping

Common Ansible Installation Issues

Symptom Likely cause Fix
No match for argument: ansible On tested Rocky 10.2 repos, legacy ansible name did not resolve sudo dnf install ansible-core; run dnf search ansible to see what your EPEL set offers
No match for argument: ansible-navigator No navigator RPM on EL10 pipx install ansible-dev-tools or pip install --user 'ansible-navigator[ansible-core]'
ansible-navigator: command not found ~/.local/bin not on PATH Add to ~/.bashrc or run pipx ensurepath
Wrong ansible version / wrong binary Multiple installs on one user which ansible; remove duplicate method
ansible shows 2.21+ after pip navigator only pip pulled newer ansible-core into user site pip uninstall ansible-core; keep distro package from Method 1
pip/pipx SSL errors on PyPI Proxy or CA trust Fix certificates; home labs should reach PyPI cleanly
Empty ansible-galaxy collection list No collection RPMs or Galaxy installs yet Method 2 RPM or ansible-galaxy collection install
Navigator image pull fails No HTTPS or low disk Check network; podman system prune
podman: command not found Podman not installed sudo dnf install -y podman

What to Do After Installing Ansible

  1. ansible.cfg — project defaults, precedence, and ansible-navigator.yml
  2. Ansible project directory structure — inventory, playbooks, roles folders
  3. Ansible inventory files — groups and host variables
  4. Ansible ad-hoc commands — first modules against managed hosts

References


Summary

On Rocky Linux 10, install ansible-core with dnf from AppStream for most labs. On the tested Rocky 10.2 repo set, add collections with EPEL ansible-collection-* RPMs or Ansible Galaxy rather than expecting dnf install ansible to resolve. Use pipx or pip when you need a PyPI-only engine. Add ansible-navigator with ansible-dev-tools (recommended) or ansible-navigator[ansible-core], plus Podman when you work with execution environments. Verify with ansible --version, ansible-galaxy collection list, and ansible localhost -m ansible.builtin.ping, then configure ansible.cfg on your control node.


Frequently Asked Questions

1. Should I install ansible or ansible-core on Rocky Linux 10?

Install ansible-core from AppStream for production-style labs. On the tested Rocky Linux 10.2 repo set, dnf install ansible did not resolve. Use pip install ansible only when you deliberately want the full PyPI bundle with many collections pulled from the internet.

2. Why does dnf install ansible fail on Rocky Linux 10?

AppStream ships ansible-core as the engine RPM. On our tested Rocky 10.2 repositories, dnf install ansible did not resolve—use sudo dnf install ansible-core, then add collections from EPEL RPMs or Ansible Galaxy. EPEL availability can change; verify with dnf search ansible.

3. Should I install Ansible on rocky1 and rocky2?

Only on rocky1, the control node. rocky2 is a managed node—it needs SSH and Python 3 from lab setup, not ansible-core or ansible-navigator. Ansible connects to rocky2 over SSH when you run playbooks from rocky1.

4. Do managed nodes need Ansible installed?

No. Install Ansible only on the control node. Managed nodes need SSH, Python 3, and a user your control node can reach—they stay agentless.

5. How do I install ansible-navigator on Rocky Linux 10?

ansible-navigator is not an RPM on EL10. Upstream recommends the ansible-dev-tools package for the full dev-tools stack. The official example uses pip3 install ansible-dev-tools; you can also use pipx for an isolated user install if it works in your environment. Install Podman if you use execution environments.

6. What should I do after installing Ansible?

Create ansible.cfg and inventory on the control node, then run ad hoc commands or playbooks. Follow the ansible.cfg and project directory guides linked at the end of this walkthrough.
Deepak Prasad

R&D Engineer

Founder of GoLinuxCloud with more than 15 years of expertise in Linux, Python, Go, Laravel, DevOps, Kubernetes, Git, Shell scripting, OpenShift, AWS, Networking, and Security. With extensive …