Ansible OEL 8 DevOps · OEL 8 · Setup

AnsibleInstalling Ansible on the Control Node

Three ways to get Ansible on your control node — pip (recommended), the OEL 8 dnf repo, and Homebrew on macOS. We also cover what version to pick and how to verify the install.

MethodWhen to pick itVersion freshness
pip install ansibleRecommended for everyone — works on every OSLatest stable
dnf install ansible (OEL 8)You want one-line install, OS-managedOften a few minor versions behind
brew install ansible (macOS)You're on a Mac and already use HomebrewLatest stable
From source (git)Contributing to Ansible itselfBleeding edge
💡 Note: Ansible is just Python — it does not need to be installed on the managed nodes. Only the control node needs it. Managed nodes only need Python 3 (already present on OEL 8).
BASH — pip install on OEL 8
# 1. install Python 3 + pip if not already present
sudo dnf install -y python3 python3-pip

# 2. install Ansible into your user site (no root needed)
pip3 install --user ansible

# 3. add user-pip's bin to PATH (one time)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

# 4. verify
ansible --version

You should see something like:

OUTPUT — ansible --version
ansible [core 2.16.x]
  config file = None
  configured module search path = ['/home/deploy/.ansible/plugins/modules', ...]
  ansible python module location = /home/deploy/.local/lib/python3.9/site-packages/ansible
  python version = 3.9.16 (main, Jul ...)  [GCC 8.5.0 20210514 (Red Hat 8.5.0-22)]
BASH — dnf install on OEL 8
# Ansible lives in the EPEL repo for OEL 8
sudo dnf install -y oracle-epel-release-el8
sudo dnf install -y ansible-core

# Verify
ansible --version
⚠ Warning: The dnf-packaged version is usually 6–18 months behind the latest pip release. For production-critical work — especially anything touching the community.mysql or community.postgresql collections — prefer pip so you get current modules.
BASH — Homebrew install on macOS
# Homebrew bundles a current Python and Ansible
brew install ansible

# Verify
ansible --version

There are two packages on PyPI: ansible-core (the engine + a tiny set of built-in modules) and ansible (which is ansible-core + ~100 community collections pre-bundled).

PackageWhat it bundlesPick when
ansible-coreEngine + ansible.builtin.* onlyYou want a slim install and will pull collections via ansible-galaxy as needed
ansibleEngine + ~100 collections (community.mysql, community.postgresql, ansible.posix, …)You want batteries included for typical infra work
💡 Tip: For this database-focused series we recommend pip3 install --user ansible (the bundled one) so you immediately have community.mysql, community.postgresql, and ansible.posix available without an extra install step.
BASH — Sanity check
# Show ansible version and Python it's using
ansible --version

# Show all installed collections
ansible-galaxy collection list

# Run a no-op against localhost
ansible localhost -m ansible.builtin.ping
✅ Tip: If ping returns SUCCESS => pong against localhost you're done — control node is ready. Next page: setting up SSH keys to managed nodes.