Ansible installation fails on standalone Oracle Linux

I have a standalone Oracle Linux server which has no connectivity to the internet.

I was following a blog which directed me to download all ansible dependent setup files and install them using the below command.

[root@host1 Ansible]# yum localinstall -y python-crypto-2.6.1-1.el7.rf.x86_64.rpm python-httplib2-0.9.2-0.2.el7.noarch.rpm python-jinja2-2.2.1-1.el6.rf.x86_64.rpm python-keyczar-0.71c-2.el7.noarch.rpm sshpass-1.05-1.el7.rf.x86_64.rpm
Loaded plugins: langpacks
Examining python-crypto-2.6.1-1.el7.rf.x86_64.rpm: python-crypto-2.6.1-1.el7.rf.x86_64
Marking python-crypto-2.6.1-1.el7.rf.x86_64.rpm to be installed
Examining python-httplib2-0.9.2-0.2.el7.noarch.rpm: python-httplib2-0.9.2-0.2.el7.noarch
Marking python-httplib2-0.9.2-0.2.el7.noarch.rpm to be installed
Examining python-jinja2-2.2.1-1.el6.rf.x86_64.rpm: python-jinja2-2.2.1-1.el6.rf.x86_64
Marking python-jinja2-2.2.1-1.el6.rf.x86_64.rpm to be installed
Examining python-keyczar-0.71c-2.el7.noarch.rpm: python-keyczar-0.71c-2.el7.noarch
Marking python-keyczar-0.71c-2.el7.noarch.rpm to be installed
Examining sshpass-1.05-1.el7.rf.x86_64.rpm: sshpass-1.05-1.el7.rf.x86_64
Marking sshpass-1.05-1.el7.rf.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package python-crypto.x86_64 0:2.6.1-1.el7.rf will be installed
---> Package python-httplib2.noarch 0:0.9.2-0.2.el7 will be installed
---> Package python-jinja2.x86_64 0:2.2.1-1.el6.rf will be installed
--> Processing Dependency: python(abi) = 2.6 for package: python-jinja2-2.2.1-1.el6.rf.x86_64
http://10.9.104.84/yum/OracleLinux/OL7/addons/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://10.9.104.84/yum/OracleLinux/OL7/addons/x86_64/repodata/repomd.xml:(28, 'Connection timed out after 30001 milliseconds')
Trying other mirror.
http://10.9.104.84/yum/OracleLinux/OL7/addons/x86_64/repodata/repomd.xml:[Errno 12] Timeout on ]http://10.9.104.84/yum/OracleLinux/OL7/addons/x86_64/repodata/repomd.xml: (28, 'Connection timed out after 30001 milliseconds')
Trying other mirror

However, I get the timeout error as the Yum is trying to connect to the internet as seen above.

[root@host1 Ansible]# uname -a
Linux host1 4.14.35-1844.4.5.el7uek.x86_64 #2 SMP Tue Apr 9 00:29:47 PDT 2019 x86_64 x86_64 x86_64 GNU/Linux

Is there a way to avoid this timeout issue ?

Try to increase your TCP/IP keepalive parameters:

Connection timed out after 30001 milliseconds

Linux has built-in support for keepalive.

You also need procfs support and sysctl support to be able to configure the kernel parameters at runtime.

README:

How will keep alive help when my system is offline i.e has no connection to the outside world (internet) ?

I have no idea exactly what you are doing; but your logfiles show a network connection and your network connection shows a timeout.

A network connection is a network connection, regardless if that connection is on a local LAN segment or going across the globe to exotic places.

I did not create your logfile, I am just reading it and your logfile shows a network connection (attempt) and a timeout.

What is your read of the logfile?

Outgoing network connectivity is disabled for this server as per security policy.

Is there a way we can tell yum not to look for files across URLs ?

It's probably a good idea for you to read the yum.conf man page.

https://www.unix.com/man-page/linux/5/yum.conf/

You can configure yum to exclude all those files you don't want yum to attempt to download.

The system requires a major dependency, a python programming language.

Processing Dependency: python(abi) = 2.6 for package: python-jinja2-2.2.1-1.el6.rf.x86_64

So either download all the rpms required, or enable access to internet repositories.
On a box which has access to internet and is the exact same version of OEL you can use yum to download only.
Then copy all the packages and execute yum localinstall against those.

yum install --downloadonly --downloaddir=<directory> <packages>

Check out proxy directive, suggestion is to use a simple squid proxy as a one time operation.

Regards
Peasant.

1 Like

Enabling the proxy for yum helped.