Where do I install Ansible from

I am finally after 2+ years working on learning to work with and write Ansible.

I have a server I built that I intend to install Ansible on but with an RPM hopefully from a repo; it will be my Ansible Control Node. I also have 4 other VMs that I am going to treat as my Ansible Managed Nodes.

The problem is if I attempt to perform a dnf install ansible* I do not see ansible-core or a package simply called “ansible.”

Is ALMA Linux not supporting Ansible in any way? Seems like a silly question but I am not finding what I would expect to be run-of-the-mill packages available.

Thanks all.

Try ‘dnf list *ansible*’. Is there centos-release*?

FYI on a fully patched machine:

$ dnf list *ansible*
Last metadata expiration check: 0:00:34 ago on Thu 28 Apr 2022 08:52:29 BST.
Available Packages
ansible.noarch                                                            2.9.27-1.el8                               epel     
ansible-collection-ansible-posix.noarch                                   1.2.0-1.el8                                epel     
ansible-collection-community-general.noarch                               3.8.6-1.el8                                epel     
ansible-collection-community-mysql.noarch                                 3.1.0-1.el8                                epel     
ansible-collection-microsoft-sql.noarch                                   1.1.0-1.el8                                appstream
ansible-collection-netbox-netbox.noarch                                   3.5.1-1.el8                                epel     
ansible-collection-redhat-rhel_mgmt.noarch                                1.0.0-2.el8                                appstream
ansible-doc.noarch                                                        2.9.27-1.el8                               epel     
ansible-freeipa.noarch                                                    0.3.8-1.el8                                appstream
ansible-freeipa-tests.noarch                                              0.3.8-1.el8                                appstream
ansible-pcp.noarch                                                        2.2.1-1.el8                                appstream
ansible-test.noarch                                                       2.9.27-1.el8                               epel     
centos-release-ansible-29.noarch                                          1-2.el8                                    extras   
python-sphinx_ansible_theme-doc.noarch                                    0.3.2-1.el8                                epel     
python3-ansible-lint.noarch                                               3.5.1-1.el8                                epel     
python3-sphinx_ansible_theme.noarch                                       0.3.2-1.el8                                epel     
vim-ansible.noarch                                                        3.2-1.el8                                  epel

I don’t run it myself, but would a simple dnf install ansible not pull in all the required packages?

If you can’t see the EPEL packages, ensure that you have already installed epel-release.noarch.

1 Like

I use that centos-release-ansible-29 repository. It is maintained by CentOS SIG and has different packaging than EPEL.

@jlehtone do you use Ansible at all? I am wondering if I should add the epel-release. I had to dig a little deeper than I would hope but found instructions to install epel-release and then install ansible, both using yum|dnf.

Yes, I do, but I run most of it from CentOS 7 machines. (The managed systems have been CentOS 5, 6, 7, 8, and Alma 8, 9.)

I did use EPEL-version for a while, but then found CentOS SIG repos, which like module streams do not rebase. So now I do have done:

dnf install centos-release-ansible-29  # to get repo
dnf install ansible                    # to get program

However, the Ansible 2.9 is old now, and if RHEL 8.6 will have ansible-core and EPEL add more tools for it, then it makes sense to do now:

dnf install epel-release  # to get repo
dnf install ansible       # to get program

(If one is running from Alma, ect. With CentOS 7 I have to consider more carefully whether it makes sense – there will be some porting of playbooks, I presume.)

I’ve written most of the roles and playbooks that I use myself as that did support learning the tool.
Red Hat offers “system roles” now and documents them within RHEL docs, so those are a good option too.

1 Like

Again, I don’t use it. If it helps Alma/EPEL 9 appears to be geared up:

$ dnf list *ansible*
AlmaLinux 9.0-beta - BaseOS                                                                   2.7 kB/s | 3.9 kB     00:01    
AlmaLinux 9.0-beta - AppStream                                                                6.4 kB/s | 3.9 kB     00:00    
AlmaLinux 9.0-beta - Extras packages                                                          6.8 kB/s | 3.8 kB     00:00    
Extra Packages for Enterprise Linux 9 - x86_64                                                1.9 MB/s | 5.5 MB     00:02    
Extra Packages for Enterprise Linux 9 - Next - x86_64                                         231 kB/s | 167 kB     00:00    
Available Packages
ansible-collection-community-general.noarch                               4.7.0-1.el9                                epel     
ansible-collection-community-mysql.noarch                                 3.1.0-2.el9                                epel     
ansible-collection-community-rabbitmq.noarch                              1.1.0-1.el9                                epel     
ansible-collection-containers-podman.noarch                               1.9.3-1.el9                                epel     
ansible-collection-microsoft-sql.noarch                                   1.1.0-2.el9                                appstream
ansible-core.x86_64                                                       2.12.2-1.el9                               appstream
ansible-freeipa.noarch                                                    1.6.3-1.el9                                appstream
ansible-freeipa-tests.noarch                                              1.6.3-1.el9                                appstream
ansible-packaging.noarch                                                  1-1.el9                                    epel     
ansible-pcp.noarch                                                        2.2.2-2.el9                                appstream
ansible-test.x86_64                                                       2.12.2-1.el9                               appstream
python3-ansible-lint.noarch                                               1:5.0.7-1.el9                              epel   
  • all at your own risk of course! :slight_smile:

Thanks @jlehtone this is the way I went last night.

I wasn’t sure if there was another way, but this did work for me on ALMA Linux.

Thanks @MartinR , I installed the epel-release package for the EPEL repo and then installed Ansible from there.