Cant install ansible offline

I have a docker container that already has ansible 2.8. I am trying to update it to 2.18. the way it works now is that the container is installing packages from a pypi server.

example: bash -c pip install -i https://pypi.eie.io/simple --trusted-host pypi.eie ansible==2.18.2

The machine does not have access to the internet nor do I have access to pypi server right now.

I put the ansible tar file on the local machine and did:

python3 -m pip install --upgrade /tmp/ansible_core2.18.2.tar.gz

but I keep getting

wARNING: Disabling truststore since ssi support is missing

wARNING: Pip is configured with locations that require TLS/SSL, however the ssl module

EPRECATION: Loading egg at /us/local/Tib/python3.13/site-packages/setuptools-75. 8. 0-p change. A possible replacement is to use pip for package installation. Discussion can t

rocessing -/ansible core-2.18. 2.tar• gz

Installing buiid dependencies •• error

error: subprocess-exited-with-error

x pip subprocess to install build dependencies did not run successfully.

exit code: 1

→ [10 lines of output]

WARNING: Disabling truststore since ssl support is missing

WARNING: pip is configured with locations that require LS/SSL, however the ssl modi

read=None, redirect=None, Status-Non

WARNING: Retrying (Retry(total=3, connect=None,

read-None, redirect=None, status=Non

HTTPS URL because the SSL module is not available. ")*: /simple/setuptools/

WARNING: Retrying (Retry(total=2, connect=None,

read-None, redirect=None, status=None

HTTPS URL because the SSL module is not available. ")*: /simple/setuptools/

WARNING: Retrying Retry(total-l, connect-None,

read-None, redirect=None, status-None

HTTPS URL because the SSL module is not available.")': /simple/setuptools/

WARNING: Retrying (Retry(total=0,

connect=None,

read-None, redirect-None, status=None)

HTTPS URL because the SSL module is not available.")': /simple/setuptools/

Could not fetch URL https://pypi.org/simple/setuptools/: There was a problen confirmin g', port-443): Max retries exceeded with url: /simple/setuptools/ (Caused by SSLError (*Can't Table.)) - skipping

ERROR: Could not find a version that satisfies the requirement setuptools<=75.8.0,>=66.

ERROR: No matching distribution found for setuptools<=75.8.0,>=66.1.0

Lend of outputi

note: This error originates from a subprocess, and is likely not a problem with pip.

WARNING: Disabling truststore since ssl support is missing

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Pyth

Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssi certi

: Max retries exceeded with url: /simple/pip/ (Caused by SSLError ("Can't connect to HTTPS URL I error: subprocess-exited-with-error

x pip subprocess to install build dependencies did not run successfully.

exit code: 1

- See above for output.

I dont have access to this pypi server a the moment. It looks like it keeps looking for it to install.

How do I make it look locally for the packages?

I dont have a file called /etc/pip.conf or /etc/xdg/pip/pip.conf

pip3 list |grep setup
setuptools 75.8.0

python version:
3.13.2

Hi James,

Ansible package is not self contained so it has many Python dependencies and it has to pull them from pypi. You either have to have network connectivity to pypi or hunt for all the dependencies.

Since this is a container, it’s maybe best to install/update Ansible on a machine with network connectivity and then transfer the container image to the airgapped machine.

2 Likes

Hello,

So i was able to get all of the dependies over the offline environment but I am running into this issue here:
Could load RPM file: python3-cryptography-36. 0.1-4. e19. x86_64. rm. Could not open: python3-cryptography-36. 0.1-4. e19. x86_64. rpm


yum --disablerepo-nexus --disableplugin-subscription-manager -y install ansible-core-2.14.18-1.e19.x86_64.rpm -2. e19. noarch.rpm python3-packaging-20.9-5. e19. noarch. rpm python3-pyyan1-5.4.1-6. e19. x86_64.rpm coreutils-singie-8. 32-3 sensors-Tibs-3.6. 0-10. e19.x86_64.rpm python3-pexpect-4. 8. 0-7. e19. noar ch.rpm python3-requests-kerberos-0. m expect-5.45.4-16. e19.86_64.rpm python3-cryptography-36.0.1-4. e19. x86_64.rpm python3-pid-2.2. 3-12. e19. no ns/ 9a3d95713 1velib-0.5.4-S. e19. noarch. rpm net-smp-agent-libs-5. 9.1-17. e19.x86_64.rpm python3-kerberos-1. 3.0-11. e19.1. x86_64 1-14, e19. noarch. rpm sshpass-1. 09-4. e19.x86_64.rpm krb5-pkinit-1. 21.1-4.e19_5.x86_64.rpm net-snmp-1ibs-5.9.1-17.els level-3.4.2-8. hon3-markupsafe-2.1.1-4, e19. x86_64. rpm python3-ptyprocess-0.6. 0-12. e19. noarch.rpm vim-common-8.2. 2637-21. e19. x86_64. rpm • x86_64. rpm python3-netaddr-0. 9. 0-2. e19. noarch. rpm 1ibselinux-3.6-1. e19. x86_64.rpm OpeniPMI-libs-2.0.3 python3-netaddr-shel1-0. 9. 0-2. e19. noarch. rpm python3-pyparsing-2.4. 7-9. e19. noarch.rpm libffi-devel-3.4.2-8. e19. x86_64. rpm ope t a docker comm 9_3.1. x86_64. гр Can not load RPM file: python3-cryptography-36. 0.1-4. e19. ×86_64. rm. affi-devel-3.4. 2Can not load RPM file: python3-pyparsing-2.4.7-9. e19. noarch. rpm. Could not open: python3-cryptography-36.0.1-4. e19. x86_64. rpm python3-pyparsing-2.4.7-
could not load RPM file: python3-cryptography-36. 0.1-4. e19. x86_64. rm. Could not open: python3-cryptography-36. 0.1-4. e19. x86_64. rpm




these are the rpm pckages all in in dir:

ansible-core-2.14.18-1. e19.x86_64. rpm

: DEST_PATH

coreutils-single-8. 32-36. e19. x86_64. rpm device-mapper-1ibs-1. 02.170-6. e17. x86_64.rpm

local Filesystem

dracut-033-572. e17. x86_64. rpm

openss 1-devel-3.2.

expect-5.45.4-16. e19.x86_64. rpm glibc-2.17-317. e17.x86_64.rpm

p openss1-devel-3.2.

1pmitool-1. 8.18-27. e19. x86_64.rpm

*kmod-20-28. e17.Ă—86-

64. pm

p libffi-devel-3.4.2 kpartx-0.4. 9-133. e17. x86_64.rpm

cp 1ibffi-devel-3.4.2

kros-pkinit-1. 21.1-4.el9_5. x86_64. rm

krb5-workstation-1.21.1-4. e19_5. x86_64. rpm libffi-devel-3.4. 2-8. e19. x86_64. rpm

Tibselinux-3.6-1. e19.x86_64.rpm

Im sensors-3.6.0-10. e19. x86_64. rpm

Im sensors-3.6.0-20. e110.x86_64.rpm

1m_sensors-1ibs-3. 6. 0-10.e19. x86_64.rpm

net-snmp-5. 9.1-17.el9.x86_64.rpm

net-snmp-agent-libs-5.9.1-17. e19. x86_64. rpm net-smp-libs-5.9.1-17. e19. x86_64. rpm newr pms

OpenIPMI-2. 0. 36-1. e19. x86_64. rpm

OpenIPM-11bs-2. 0.36-1. e19. x86_64.Đ“Ń€

openss 1-devel-3. 2. 2-6. e19_5.1.x86_64. rpm per 1-5.16. 3-297. e17. x86_64. rpm python3.12-ply-3.11-2. e19. noar ch. rpm python3-crti-1.14.5-5. e19. x86_64. rpm python3-cryptography-36.0.1-4. e19. x86_64. rpm python3-kert

3.0-11. e19.1. x86_64-грт

python3-markupsafe-2.1.1-4. e19. x86_64. rpm python3-netaddr-0. 9. 0-2. e19. noarch.rpm

type or paste code here

Your paste is kind of messed up. Extra spaces, “rm” instead of “rpm”, cyrillic letters and what not… it’s hard to tell what happened :slightly_smiling_face:

It could be a corrupted or partially downloaded rpm package.

Sorry so I got ansible to install finally but when I do a --version I get this:
i have python 3.12 with ansible 2.14

Traceback (most recent call last):

File "/usr/bin/ansible", line 33, in ‹ modules

sysexit(loadentry point('ansible-core==2.14,18', 'console_scripts", 'ansible')O)

File "/usr/bin/ansible" line 25, in importlib_load_entry-point return next (matches). loadO

File "/usr/lib64/python3. 9/import1ib/metadata. py", line 86, in load

module = import module(match. group('module"))

File "/usr/1ib64/python3. 9/importlib/_init_py", line 127, in import module

return _bootstrap. _gcd_import(name[level:], package, level)

File

"‹frozen importlib._bootstrap>"

, line 1030, in -ged_import

File "«frozen importlib._bootstrap›" line 1007, in _find_and_load

File "«frozen importlib._bootstrap›"

line 972, in _find_and_load_unlocked

File

"frozen importlib._bootstrap›"

line 228, in _call with_frames_removed

File "‹frozen importlib._bootstrap»"

line 1030, in

_gcd_import

File "«frozen importlib._bootstrap›"

line 1007, in _find_and_load

File "«frozen importlib._bootstrap›"

File

line 986, in _find_and_load_unlocked

"«frozen importlib._bootstrap»", line 680, in _load unlocked

I

File

"‹frozen importlib._bootstrap_external>", line 850, in exec module

File "«frozen importlib._bootstrap>", line 228, in _call with_frames renoved

File "/usr/lib/python3.9/site-packages/ansible/cli/_init_py", line 102, in ‹module from ansible. parsing. dataloader import DataLoader

File "/usr/lib/python3.9/site-packages/ansible/parsing/dataloader.py", line 17, in a from ansible. module utils.basic import is_executable

File "/usr/lib/python3.9/site-packages/ansible/module utils/basic.py", line 71, in am

has journal = hasattr (journal, 'sendv') and systemd_daemon. bootedO

PermissionError: Errno 1] Operation not permtted

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.