How to install Ansible in CentOS Stream version 9.

Today we're going to talk about the easier way to install and maintain Ansible inside CentO Stream version 9 using the system AppStream repository.

I'm Luca Berton and welcome to today's episode of Ansible Pilot

How to install Ansible in CentOS Stream 9

  • ansible-core in system AppStream repository
  • use Extra Packages for Enterprise Linux - EPEL Next additional packages for CentOS Stream

The easier way to install and maintain Ansible inside CentOS Stream version 9 is using the system AppStream repository.

Another way is to use the additional EPEL Next repository. This repository is maintained by the Fedora Special Interest Group and that manages a high-quality set of additional packages for CentOS Stream, similar to Extra Packages for Enterprise Linux (EPEL) additional packages target for Red Hat Enterprise Linux (RHEL), CentOS, and Scientific Linux (SL) and Oracle Linux (OL).

See also:

[Ansible terminology - ansible vs ansible-core packages](/articles/ansible-terminology-ansible-vs-ansible-core-packages).

Links

  • [CentOS Stream Download](https://www.centos.org/centos-stream/)
  • [EPEL 9 is now available](https://communityblog.fedoraproject.org/epel-9-is-now-available/)
  • [Introducing CentOS Stream 9](https://blog.centos.org/2021/12/introducing-centos-stream-9/)
  • [Extra Packages for Enterprise Linux (EPEL)](https://docs.fedoraproject.org/en-US/epel/)

## Playbook

Install Ansible in CentOS Stream version 9 via AppStream system repository.

code

  • Install-Ansible-CentOS-Stream9.sh

``bash

#!/bin/bash

sudo dnf install ansible-core

`

execution

``bash

$ ssh [email protected]

[devops@centos-stream ~]$ sudo su

[root@centos-stream devops]# cat /etc/redhat-release

CentOS Stream release 9

[root@centos-stream devops]# cat /etc/os-release

NAME="CentOS Stream"

VERSION="9"

ID="centos"

ID_LIKE="rhel fedora"

VERSION_ID="9"

PLATFORM_ID="platform:el9"

PRETTY_NAME="CentOS Stream 9"

ANSI_COLOR="0;31"

CPE_NAME="cpe:/o:centos:centos:9"

HOME_URL="https://centos.org/"

BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 9"

REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"

[root@centos-stream devops]# hostnamectl

Static hostname: centos-stream.example.com

Icon name: computer-vm

Chassis: vm

Machine ID: 27ac33d81e2a400cbdaf6ae0b2b82e1d

Boot ID: 4060493b76fc4cc680defa0ffe99af41

Virtualization: oracle

Operating System: CentOS Stream 9

CPE OS Name: cpe:/o:centos:centos:9

Kernel: Linux 5.14.0-17.el9.x86_64

Architecture: x86-64

Hardware Vendor: innotek GmbH

Hardware Model: VirtualBox

[root@centos-stream devops]# dnf search ansible

Updating Subscription Management repositories.

Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

CentOS Stream 9 - BaseOS