In order to install Ansible on Centos 8; epel-release package needs to be installed. Due to Centos8 end of life, no new packages and security updates are not maintained and all repos has moved under vault.centos.org thus CentOS-* repos need to replace then we can install epel-release. Once you install epel-release ansilbe installation gives below error since June 2022.
- nothing provides (ansible-core >= 2.12.2 with ansible-core < 2.13) needed by ansible-5.4.0-2.el8.noarch
(try to add ‘–skip-broken’ to skip uninstallable packages or ‘–nobest’ to use not only best candidate packages)
2
Answers
The solutions for that I have created a small script it changes centos-repos and install epel-relase then changes epel's repo and install Ansible 2.9.27-1.el8 with all dependencies.
I also stucked by this question,and centos version was 8.5.2111 (not centos stream)
and i just manually download ansible-core.rpm and it’s dependency and install them,
then i can install the ansible by
dnf install ansible
the detail step was: