Ansible: How to install on offline environment

This guide shows how to install Ansible on offline (blocked internet access) situations.
At this time, I installed Ansible 2.9 to CentOS 8.4.

Note: About installation of Ansible 7 to CentOS Steam 9 is the following post.
>> Ansible: How to install ansible 7 (available offline (blocked internet access) situations)

Note: The entire procedures for setting up to manage Windows Server with Ansible are the following posts.

Preparations

Make dnf (yum) command add packages from ISO

Refer to the following post and make dnf (yum) command add packages from mounted DVD / ISO image.

>> How to add packages from DVD / ISO by dnf (yum) on Linux

Install Python 3.x

Refer to the following post and install newer Python 3.x.
Note: Default Python3 version on RHEL 8.4 is Python 3.6.

>> How to install Python 3.x from source on Linux

Procedures

1. Download packages

(1) Download the following rpm files on an online (internet-accessible) environment.

Note: File name is as of the day I installed.

(2) Copy the downloaded rpm files to the server that Ansible is to be installed on.

2. Install required packages

Install rpm packages in sequence.

  • sshpass
chmod 755 sshpass-1.06-9.el8.x86_64.rpm
dnf -y install sshpass-1.06-9.el8.x86_64.rpm
  • python3-httplib2
chmod 755 python3-httplib2-0.18.1-3.el7.noarch.rpm
dnf -y install python3-httplib2-0.18.1-3.el7.noarch.rpm
  • python-passlib
chmod 755 python-passlib-1.6.5-2.el7.noarch.rpm
dnf -y install python-passlib-1.6.5-2.el7.noarch.rpm

4. Install Ansible

(1) Install rpm.

chmod 755 ansible-2.9.27-1.el8.noarch.rpm
dnf -y install ansible-2.9.27-1.el8.noarch.rpm

(2) Confirm that Ansible is installed correctly.

ansible --version

If it shows Ansible version, path of config file and so on like the following, installed successfully..

ansible 2.9.27
config file = /etc/ansible/ansible.cfg
      ・
      ・
      ・

That’s about it.

If you proceed to install pywinrm or request_credssp, refer to the following posts.
>> How to install pywinrm on offline environment
>> How to install requests_credssp on offline environment