Offline installation of ansible2.5 version (detailed installation document)

                                             Offline installation of ansible2.5 version (detailed installation document)

As an automatic operation and maintenance artifact for small and medium-sized enterprises, ansible is convenient, fast and practical. Needless to say, we usually use it as the bastion of the intranet. Since it is an intranet, it naturally needs to be installed offline, and ansible is a Python project. , Python project installation has a feature, that is, there are many strong dependencies.

(Explain, there are strong dependencies and weak dependencies. Strong dependencies have detailed requirements for the installation order and the corresponding version that they rely on. They must match exactly, like one, a pearl necklace. Each pearl has requirements for the size, color, and so on. , The sequence of necklaces is also fixed, for example, only left to right, or right to left, pay attention to an order problem and a version corresponding. Weak dependence is similar to a pearl necklace, you can wear pearls from the left or from the right , Different pearl sizes do not affect the wearing of the necklace)

Prerequisite 1: Offline installation is recommended to use the system installation disk as a local warehouse, for example, mount an ISO file of the centos7 system, and then the local warehouse can point to the mount point. (An ISO file for a system installation is only 3 4 g in size. However, there is a complete range of things in it. Any software that is not too partial can use the content in this file to quickly install the required environment).

Prerequisite 2: pip and wheel, pip, Python package manager, wheel, whl file manager. Download address: Link: https://pan.baidu.com/s/1owRzHB4r29CKlc-vBQcbqQ
Extraction code: pipe 
copy this content and open the Baidu Netdisk  mobile phone App, the operation is more convenient

 

Prerequisite 3: Ansible 2.5 installation package and its strong dependencies. Its dependencies are installed in order, of course, there are also ways to be lazy. Download address: Link: https://pan.baidu.com/s/1bxzJMxUSRoFuPyrMJZq45Q
Extraction code  : Ansi
copy this content and open the Baidu SkyDrive mobile app, which is more convenient to operate-from the sharing of Baidu SkyDrive  Super Member V3

Assuming that the above two folders have been downloaded from Baidu network disk, and the local warehouse has been built, then the offline installation journey of ansible can be officially started.

1,yum install  -y gcc gcc-c++ libffi-devel python-devel  openssl-devel

The compilation environment is still needed, just a few packages, the local warehouse can be installed.

2. Installation of pip and wheel oo

Upload the file downloaded in condition 2 to the server, rpm -ivh ./*.rpm, install the two RPMs inside first, then pip install the rest, suggest pip install s setuptools-18.5.tar.gz, pip install pip -20.3.4-py2.py3-none-any.whl, pip install wheel-0.36.2-py2.py3-none-any.whl

3. Installation dependencies

The content of request.txt is as follows:

ansible @ file:///root/ansible/ansible-2.5.0a1.tar.gz
asn1crypto @ file:///root/ansible/asn1crypto-0.24.0.tar.gz
bcrypt @ file:///root/ansible/bcrypt-3.1.4.tar.gz
cffi @ file:///root/ansible/cffi-1.11.5.tar.gz
configobj==4.7.2
cryptography @ file:///root/ansible/cryptography-2.0.3.tar.gz
decorator==3.4.0
ecdsa @ file:///root/ansible/ecdsa-0.13.tar.gz
enum34 @ file:///root/ansible/enum34-1.1.6.tar.gz
idna @ file:///root/ansible/idna-2.6.tar.gz
iniparse==0.4
ipaddress @ file:///root/ansible/ipaddress-1.0.19.tar.gz
Jinja2 @ file:///root/ansible/Jinja2-2.9.6.tar.gz
MarkupSafe @ file:///root/ansible/MarkupSafe-1.0.tar.gz
paramiko @ file:///root/ansible/paramiko-2.3.0.tar.gz
perf==0.1
pyasn1 @ file:///root/ansible/pyasn1-0.4.2.tar.gz
pycparser @ file:///root/ansible/pycparser-2.18.tar.gz
pycrypto @ file:///root/ansible/pycrypto-2.6.1.tar.gz
pycurl==7.19.0
pygobject==3.22.0
pygpgme==0.3
pyliblzma==0.5.3
PyNaCl @ file:///root/ansible/PyNaCl-1.2.1.tar.gz
python-linux-procfs==0.4.9
pyudev==0.15
pyxattr==0.5.1
PyYAML @ file:///root/ansible/PyYAML-3.12.tar.gz
schedutils==0.4
simplejson @ file:///root/ansible/simplejson-3.13.2.tar.gz
six @ file:///root/ansible/six-1.11.0.tar.gz
slip==0.4.0
slip.dbus==0.4.0
urlgrabber==3.10
yum-metadata-parser==1.1.4

Save the above content to a file, for example, the file name is request.txt, pip install -r request.txt, here, the file downloaded in the third step is uploaded to the root directory. (Strongly rely on this installation will not succeed, hereby remind!!!)

 

 

So, how can such a strongly dependent project with an installation sequence be installed correctly?

For example, install cffi-1.11.5

 

It is required to install pycoarser first, then install it first,

[root@centos2 ansible]# pip install pycparser-2.18.tar.gz 
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Processing ./pycparser-2.18.tar.gz
Building wheels for collected packages: pycparser
  Building wheel for pycparser (setup.py) ... done
  Created wheel for pycparser: filename=pycparser-2.18-py2.py3-none-any.whl size=206950 sha256=2e98ad2cad68323b7c6039f685896192d394b6a8e5b042d9c204dd440e4bfe75
  Stored in directory: /root/.cache/pip/wheels/56/37/cf/7070ab8b197afb86371c5636f3ed11271a1194e13abc9d98d6
Successfully built pycparser
Installing collected packages: pycparser
Successfully installed pycparser-2.18
[root@centos2 ansible]# pip install cffi-1.11.5.tar.gz 
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Processing ./cffi-1.11.5.tar.gz
Requirement already satisfied: pycparser in /usr/lib/python2.7/site-packages (from cffi==1.11.5) (2.18)
Building wheels for collected packages: cffi
  Building wheel for cffi (setup.py) ... done
  Created wheel for cffi: filename=cffi-1.11.5-cp27-cp27mu-linux_x86_64.whl size=297877 sha256=3c07c228c4124abe61e9621190dd6ef3694cd0f6f7460d4d3acf583bf5d65552
  Stored in directory: /root/.cache/pip/wheels/19/5d/d4/10359ee6cf9e6a143f4d6e9c489da5324498d58926297c46ef
Successfully built cffi
Installing collected packages: cffi
Successfully installed cffi-1.11.5

 You can install it back and forth like this, just pay attention to the prompts given by pip. The specific installation sequence has to be explored by yourself.

 

 

 

 

Guess you like

Origin blog.csdn.net/alwaysbefine/article/details/114840032