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.
How to install Ansible in openSUSE Leap 15
- use repository openSUSE Leap Update
Today 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 [email protected]
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.
Conclusion
Now you know how to install the latest version of Ansible in openSUSE using the Leap Update repository. Subscribe to the YouTube channel, Medium, and Website, X (formerly Twitter) to not miss the next episode of the Ansible Pilot.
Academy
Learn the Ansible automation technology with some real-life examples in my Udemy 300+ Lessons Video Course.
My book Ansible By Examples: 200+ Automation Examples For Linux and Windows System Administrator and DevOps
Donate
Want to keep this project going? Please donate