How to install Ansible in OpenSUSE Leap 15 - Ansible install
By Luca Berton · Published 2024-01-01 · Category: installation
How to install the latest version of Ansible in openSUSE using the official SUSE Leap \"update\" repository.

How to install Ansible in openSUSE Leap?
Today we're going to talk about the easier way to install and maintain Ansible inside openSUSE 15 using the distribution repository. I'm Luca Berton and welcome to today's episode of Ansible Pilot.See also: How to install Ansible in SUSE Linux Enterprise Server (SLES) 15 SP3 - Ansible install
How to install Ansible in openSUSE Leap 15
• use repository openSUSE Leap UpdateToday we're talking about How to install Ansible in openSUSE Leap 15. The easier way to install and maintain Ansible inside openSUSE Leap version 15 is using the Leap Update repository maintained by SUSE.
## Playbook Are you ready to make your hands dirty? Let's jump in a quick live Playbook of how to install the latest version of Ansible in openSUSE.
code
• Install-Ansible-openSUSE-Leap15.sh#!/bin/bash
sudo zypper refresh
sudo zypper install ansible
sudo zypper info ansible
ansible --version
execution
$ ssh devops@opensuse.example.com
Last login: Thu Nov 18 19:05:28 2021 from 192.168.0.102
Have a lot of fun...
devops@suse:~> cat /etc/os-release
NAME="openSUSE Leap"
VERSION="15.3"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.3"
PRETTY_NAME="openSUSE Leap 15.3"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.3"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
devops@suse:~> sudo su
suse:/home/devops # zypper refresh
Repository 'Update repository of openSUSE Backports' is up to date.
Repository 'Non-OSS Repository' is up to date.
Repository 'Main Repository' is up to date.
Repository 'Update repository with updates from SUSE Linux Enterprise 15' is up to date.
Repository 'Main Update Repository' is up to date.
Repository 'Update Repository (Non-Oss)' is up to date.
All repositories have been refreshed.
suse:/home/devops # zypper info ansible
Loading repository data...
Reading installed packages...
Information for package ansible:
--------------------------------
Repository : Update repository with updates from SUSE Linux Enterprise 15
Name : ansible
Version : 2.9.21-1.7.1
Arch : noarch
Vendor : SUSE LLC <https://www.suse.com/>
Installed Size : 96.1 MiB
Installed : No
Status : not installed
Source package : ansible-2.9.21-1.7.1.src
Summary : SSH-based configuration management, deployment, and task execution system
Description :
Ansible is a radically simple model-driven configuration management, multi-node
deployment, and remote task execution system. Ansible works over SSH and does
not require any software or daemons to be installed on remote nodes. Extension
modules can be written in any language and are transferred to managed machines
automatically.
suse:/home/devops # zypper install ansible
Loading repository data...
Reading installed packages...
Resolving package dependencies...
The following 24 NEW packages are going to be installed:
ansible libsodium23 python3-Babel python3-Jinja2 python3-MarkupSafe python3-PyNaCl python3-PyYAML
python3-appdirs python3-asn1crypto python3-bcrypt python3-cffi python3-cryptography
python3-jmespath python3-packaging python3-paramiko python3-passlib python3-ply python3-pyasn1
python3-pycparser python3-pyparsing python3-pytz python3-setuptools python3-simplejson
python3-six
24 new packages to install.
Overall download size: 21.3 MiB. Already cached: 0 B. After the operation, additional 143.6 MiB
will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package libsodium23-1.0.16-4.3.18.x86_64 (1/24), 153.5 KiB (335.6 KiB unpacked)
Retrieving: libsodium23-1.0.16-4.3.18.x86_64.rpm ............................................[done]
Retrieving package python3-MarkupSafe-1.0-1.29.x86_64 (2/24), 29.1 KiB ( 72.6 KiB unpacked)
Retrieving: python3-MarkupSafe-1.0-1.29.x86_64.rpm ..........................................[done]
Retrieving package python3-PyYAML-5.4.1-1.1.x86_64 (3/24), 106.6 KiB (555.8 KiB unpacked)
Retrieving: python3-PyYAML-5.4.1-1.1.x86_64.rpm .............................................[done]
Retrieving package python3-appdirs-1.4.3-1.21.noarch (4/24), 22.5 KiB ( 83.5 KiB unpacked)
Retrieving: python3-appdirs-1.4.3-1.21.noarch.rpm ...........................................[done]
Retrieving package python3-ply-3.10-1.27.noarch (5/24), 100.6 KiB (456.2 KiB unpacked)
Retrieving: python3-ply-3.10-1.27.noarch.rpm ................................................[done]
Retrieving package python3-pyparsing-2.4.7-1.24.noarch (6/24), 187.4 KiB (877.1 KiB unpacked)
Retrieving: python3-pyparsing-2.4.7-1.24.noarch.rpm .........................................[done]
Retrieving package python3-simplejson-3.17.2-1.10.x86_64 (7/24), 73.1 KiB (274.3 KiB unpacked)
Retrieving: python3-simplejson-3.17.2-1.10.x86_64.rpm .......................................[done]
Retrieving package python3-six-1.14.0-10.1.noarch (8/24), 34.9 KiB ( 99.2 KiB unpacked)
Retrieving: python3-six-1.14.0-10.1.noarch.rpm ..............................................[done]
Retrieving package python3-jmespath-0.9.3-1.21.noarch (9/24), 48.3 KiB (177.5 KiB unpacked)
Retrieving: python3-jmespath-0.9.3-1.21.noarch.rpm ..........................................[done]
Retrieving package python3-packaging-20.3-1.9.noarch (10/24), 67.5 KiB (263.1 KiB unpacked)
Retrieving: python3-packaging-20.3-1.9.noarch.rpm ...........................................[done]
Retrieving package python3-setuptools-40.5.0-6.3.1.noarch (11/24), 616.0 KiB ( 3.3 MiB unpacked)
Retrieving: python3-setuptools-40.5.0-6.3.1.noarch.rpm ......................................[done]
Retrieving package python3-asn1crypto-0.24.0-3.2.1.noarch (12/24), 176.2 KiB ( 1.2 MiB unpacked)
Retrieving: python3-asn1crypto-0.24.0-3.2.1.noarch.rpm ......................................[done]
Retrieving package python3-pyasn1-0.4.2-3.2.1.noarch (13/24), 150.2 KiB (823.2 KiB unpacked)
Retrieving: python3-pyasn1-0.4.2-3.2.1.noarch.rpm ...........................................[done]
Retrieving package python3-pycparser-2.17-3.2.1.noarch (14/24), 189.9 KiB ( 1.1 MiB unpacked)
Retrieving: python3-pycparser-2.17-3.2.1.noarch.rpm .........................................[done]
Retrieving package python3-pytz-2021.1-3.3.1.noarch (15/24), 56.6 KiB (244.6 KiB unpacked)
Retrieving: python3-pytz-2021.1-3.3.1.noarch.rpm ............................................[done]
Retrieving package python3-cffi-1.13.2-3.2.5.x86_64 (16/24), 307.1 KiB ( 1.2 MiB unpacked)
Retrieving: python3-cffi-1.13.2-3.2.5.x86_64.rpm ............................................[done]
Retrieving package python3-cryptography-2.8-10.1.x86_64 (17/24), 426.4 KiB ( 2.5 MiB unpacked)
Retrieving: python3-cryptography-2.8-10.1.x86_64.rpm ..........................[done (805.4 KiB/s)]
Retrieving package python3-Babel-2.8.0-1.6.noarch (18/24), 5.0 MiB ( 26.4 MiB unpacked)
Retrieving: python3-Babel-2.8.0-1.6.noarch.rpm ..................................[done (2.2 MiB/s)]
Retrieving package python3-bcrypt-3.2.0-1.10.x86_64 (19/24), 41.4 KiB ( 79.8 KiB unpacked)
Retrieving: python3-bcrypt-3.2.0-1.10.x86_64.rpm ..................................[done (965 B/s)]
Retrieving package python3-PyNaCl-1.2.1-3.3.1.x86_64 (20/24), 75.6 KiB (423.4 KiB unpacked)
Retrieving: python3-PyNaCl-1.2.1-3.3.1.x86_64.rpm ...........................................[done]
Retrieving package python3-Jinja2-2.10.1-3.10.2.noarch (21/24), 237.4 KiB ( 1.2 MiB unpacked)
Retrieving: python3-Jinja2-2.10.1-3.10.2.noarch.rpm .............................[done (3.8 KiB/s)]
Retrieving package python3-passlib-1.7.4-1.10.noarch (22/24), 696.2 KiB ( 4.2 MiB unpacked)
Retrieving: python3-passlib-1.7.4-1.10.noarch.rpm ...............................[done (2.8 MiB/s)]
Retrieving package python3-paramiko-2.4.2-6.9.1.noarch (23/24), 278.9 KiB ( 1.6 MiB unpacked)
Retrieving: python3-paramiko-2.4.2-6.9.1.noarch.rpm .........................................[done]
Retrieving package ansible-2.9.21-1.7.1.noarch (24/24), 12.3 MiB ( 96.1 MiB unpacked)
Retrieving: ansible-2.9.21-1.7.1.noarch.rpm .....................................[done (5.0 MiB/s)]
Checking for file conflicts: ................................................................[done]
( 1/24) Installing: libsodium23-1.0.16-4.3.18.x86_64 ........................................[done]
( 2/24) Installing: python3-MarkupSafe-1.0-1.29.x86_64 ......................................[done]
( 3/24) Installing: python3-PyYAML-5.4.1-1.1.x86_64 .........................................[done]
( 4/24) Installing: python3-appdirs-1.4.3-1.21.noarch .......................................[done]
( 5/24) Installing: python3-ply-3.10-1.27.noarch ............................................[done]
( 6/24) Installing: python3-pyparsing-2.4.7-1.24.noarch .....................................[done]
( 7/24) Installing: python3-simplejson-3.17.2-1.10.x86_64 ...................................[done]
( 8/24) Installing: python3-six-1.14.0-10.1.noarch ..........................................[done]
( 9/24) Installing: python3-jmespath-0.9.3-1.21.noarch ......................................[done]
Additional rpm output:
update-alternatives: using /usr/bin/jp-3.6 to provide /usr/bin/jp (jp) in auto mode
(10/24) Installing: python3-packaging-20.3-1.9.noarch .......................................[done]
(11/24) Installing: python3-setuptools-40.5.0-6.3.1.noarch ..................................[done]
Additional rpm output:
update-alternatives: using /usr/bin/easy_install-3.6 to provide /usr/bin/easy_install (easy_install) in auto mode
(12/24) Installing: python3-asn1crypto-0.24.0-3.2.1.noarch ..................................[done]
(13/24) Installing: python3-pyasn1-0.4.2-3.2.1.noarch .......................................[done]
(14/24) Installing: python3-pycparser-2.17-3.2.1.noarch .....................................[done]
(15/24) Installing: python3-pytz-2021.1-3.3.1.noarch ........................................[done]
(16/24) Installing: python3-cffi-1.13.2-3.2.5.x86_64 ........................................[done]
(17/24) Installing: python3-cryptography-2.8-10.1.x86_64 ....................................[done]
(18/24) Installing: python3-Babel-2.8.0-1.6.noarch ..........................................[done]
Additional rpm output:
update-alternatives: using /usr/bin/pybabel-3.6 to provide /usr/bin/pybabel (pybabel) in auto mode
(19/24) Installing: python3-bcrypt-3.2.0-1.10.x86_64 ........................................[done]
(20/24) Installing: python3-PyNaCl-1.2.1-3.3.1.x86_64 .......................................[done]
(21/24) Installing: python3-Jinja2-2.10.1-3.10.2.noarch .....................................[done]
(22/24) Installing: python3-passlib-1.7.4-1.10.noarch .......................................[done]
(23/24) Installing: python3-paramiko-2.4.2-6.9.1.noarch .....................................[done]
(24/24) Installing: ansible-2.9.21-1.7.1.noarch .............................................[done]
suse:/home/devops # zypper info ansible
Loading repository data...
Reading installed packages...
Information for package ansible:
--------------------------------
Repository : Update repository with updates from SUSE Linux Enterprise 15
Name : ansible
Version : 2.9.21-1.7.1
Arch : noarch
Vendor : SUSE LLC <https://www.suse.com/>
Installed Size : 96.1 MiB
Installed : Yes
Status : up-to-date
Source package : ansible-2.9.21-1.7.1.src
Summary : SSH-based configuration management, deployment, and task execution system
Description :
Ansible is a radically simple model-driven configuration management, multi-node
deployment, and remote task execution system. Ansible works over SSH and does
not require any software or daemons to be installed on remote nodes. Extension
modules can be written in any language and are transferred to managed machines
automatically.
suse:/home/devops # ansible --version
ansible 2.9.21
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.6.13 (default, Mar 10 2021, 18:30:35) [GCC]
before the execution
# zypper info ansible
Loading repository data...
Reading installed packages...
Information for package ansible:
--------------------------------
Repository : Update repository with updates from SUSE Linux Enterprise 15
Name : ansible
Version : 2.9.21-1.7.1
Arch : noarch
Vendor : SUSE LLC <https://www.suse.com/>
Installed Size : 96.1 MiB
Installed : No
Status : not installed
Source package : ansible-2.9.21-1.7.1.src
Summary : SSH-based configuration management, deployment, and task execution system
Description :
Ansible is a radically simple model-driven configuration management, multi-node
deployment, and remote task execution system. Ansible works over SSH and does
not require any software or daemons to be installed on remote nodes. Extension
modules can be written in any language and are transferred to managed machines
automatically.
after the execution
# zypper info ansible
Loading repository data...
Reading installed packages...
Information for package ansible:
--------------------------------
Repository : Update repository with updates from SUSE Linux Enterprise 15
Name : ansible
Version : 2.9.21-1.7.1
Arch : noarch
Vendor : SUSE LLC <https://www.suse.com/>
Installed Size : 96.1 MiB
Installed : Yes
Status : up-to-date
Source package : ansible-2.9.21-1.7.1.src
Summary : SSH-based configuration management, deployment, and task execution system
Description :
Ansible is a radically simple model-driven configuration management, multi-node
deployment, and remote task execution system. Ansible works over SSH and does
not require any software or daemons to be installed on remote nodes. Extension
modules can be written in any language and are transferred to managed machines
automatically.
Troubleshooting Common Installation Issues
If ansible --version fails or ansible localhost -m ping returns errors after installing on OpenSUSE Leap 15, the most common root causes are:
1. Wrong Python interpreter
Ansible runs on Python 3. If python3 is not in PATH or points to an old version, Ansible imports may fail. Check with:
python3 --version
which python3
ansible --version | grep "python version"
If the reported Python version is older than 3.10, install a newer interpreter via your distribution's package manager and either re-create your virtualenv or set ansible_python_interpreter in your inventory.
2. SELinux / AppArmor blocking ansible
On security-hardened distributions, mandatory access control can deny Ansible's working directories or block become privilege escalation. Symptoms include "Permission denied" on operations that succeed manually. Check with:
getenforce # SELinux: should report Permissive or Enforcing
sudo aa-status # AppArmor: lists profiles in enforce mode
Temporarily set SELinux to permissive (sudo setenforce 0) to confirm whether it's the cause; for production, write a tailored policy rather than disabling enforcement.
3. SSH key authentication failing
If ansible all -m ping works locally but fails for remote managed nodes, the issue is almost always SSH. Verify:
ssh -v user@managed-node 'echo ok'
ansible all -m ping -vvv
The verbose output will show whether the connection drops at TCP, key exchange, or authentication. Common fixes: copy your public key with ssh-copy-id, ensure PubkeyAuthentication yes in /etc/ssh/sshd_config on the managed node, and check that the user exists.
4. pip install conflicts with system packages
If you used pip instead of the system package manager and see "ModuleNotFoundError: No module named 'ansible'", the install likely landed in a virtualenv or user-site directory not on PATH. Check:
pip show ansible-core
pip show ansible
echo $PATH
Install inside a virtualenv to keep system Python clean:
python3 -m venv ~/.venvs/ansible
source ~/.venvs/ansible/bin/activate
pip install ansible
See also: Run RHEL 9.2 on Mac Using VMware Fusion: A Step-by-Step Guide
Frequently Asked Questions
What's the difference between ansible and ansible-core?
ansible-core is the engine plus the ansible.builtin collection (~50 modules). The ansible PyPI package bundles ansible-core plus hundreds of community collections, so ansible-galaxy collection list shows everything pre-installed. For minimal Execution Environments and CI, prefer ansible-core and explicitly list collections in requirements.yml.
Should I install Ansible from the package manager or pip?
The system package manager (apt/dnf/apk/pacman) is best for getting started — it installs to PATH and updates with the rest of the OS. Use pip inside a virtualenv when you need a specific version, want to install collections without root, or are building reproducible CI environments. Mixing both on the same system causes PATH ambiguity and is a frequent troubleshooting trap.
How do I update Ansible after the initial install on OpenSUSE Leap 15 -?
If installed via package manager, sudo dnf update ansible (or sudo apt upgrade ansible on Debian-family). If installed via pip, pip install --upgrade ansible inside the same virtualenv. Always read the changelog before crossing a minor version boundary (e.g. 2.18 → 2.19) — there are sometimes deprecation warnings to address before the next major.
Do I need to install anything on the managed nodes?
For Linux managed nodes: only Python 3 and an SSH server. Ansible is "agentless" — it copies its modules over SSH and runs them on the target. For Windows managed nodes you need WinRM or PSRP configured plus PowerShell 5.1+. No Ansible installation is ever required on the target.
Why does ansible localhost -m ping say "SUCCESS"? It's not a real ping.
The ansible.builtin.ping module does not send ICMP. It tests that Ansible can connect to the target, copy a Python module, execute it, and parse the JSON response. A "SUCCESS" reply means the entire transport pipeline works — which is exactly what you want to confirm after install.
What's Next
Now that Ansible is installed on OpenSUSE Leap 15, build on it:
• Write your first playbook
• Ansible inventory: organize your hosts
• Ansible variables and facts explained
• Privilege escalation with become
• Browse all Ansible tutorials
See also: How to install Ansible in AlmaLinux 9 - Ansible install
Conclusion
Now you know how to install the latest version of Ansible in openSUSE using the Leap Update repository.
Related Articles
• configuration files via Ansible template • role variables and defaults in AnsibleSee also
• How to install Ansible in Gentoo Linux - Ansible installCategory: installation
Watch the video: How to install Ansible in OpenSUSE Leap 15 - Ansible install — Video Tutorial