【Ansible】安装Ansible二进制版本最新版

        今天我们来看看如果通过二进制方式安装Ansible。为了节约时间,部分组件的安装采用了在线的方式,如python3、pip。

---在线安装python3
# yum install -y python3

---使用python3来在线下载和安装pip最新版
---https://bootstrap.pypa.io/get-pip.py
# python3 get-pip.py
Collecting pip
  Downloading pip-21.3.1-py3-none-any.whl (1.7 MB)
     |████████████████████████████████| 1.7 MB 29 kB/s             
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/wheel/
Collecting wheel
  Downloading wheel-0.37.0-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel, pip
  Attempting uninstall: pip
    Found existing installation: pip 9.0.3
    Uninstalling pip-9.0.3:
      Successfully uninstalled pip-9.0.3
Successfully installed pip-21.3.1 wheel-0.37.0

---在线下载安装ansible最新版,以及其他的依赖组件
# pip download ansible
Collecting ansible
  Downloading ansible-4.8.0.tar.gz (36.1 MB)
     |████████████████████████████████| 36.1 MB 140 kB/s            
  Preparing metadata (setup.py) ... done
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/ansible-core/
Collecting ansible-core<2.12,>=2.11.6
  Downloading ansible-core-2.11.6.tar.gz (7.0 MB)
     |████████████████████████████████| 7.0 MB 271 kB/s            
  Preparing metadata (setup.py) ... done
Collecting jinja2
  Downloading Jinja2-3.0.3-py3-none-any.whl (133 kB)
     |████████████████████████████████| 133 kB 294 kB/s            
Collecting PyYAML
  Downloading PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (603 kB)
     |████████████████████████████████| 603 kB 255 kB/s            
Collecting cryptography
  Downloading cryptography-36.0.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB)
     |████████████████████████████████| 3.8 MB 289 kB/s            
Collecting packaging
  Downloading packaging-21.3-py3-none-any.whl (40 kB)
     |████████████████████████████████| 40 kB 376 kB/s            
Collecting resolvelib<0.6.0,>=0.5.3
  Downloading resolvelib-0.5.4-py2.py3-none-any.whl (12 kB)
Collecting cffi>=1.12
  Downloading cffi-1.15.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (405 kB)
     |████████████████████████████████| 405 kB 230 kB/s            
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (30 kB)
Collecting pyparsing!=3.0.5,>=2.0.2
  Downloading pyparsing-3.0.6-py3-none-any.whl (97 kB)
     |████████████████████████████████| 97 kB 320 kB/s            
Collecting pycparser
  Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
     |████████████████████████████████| 118 kB 293 kB/s            
Saved ./ansible-4.8.0.tar.gz
Saved ./ansible-core-2.11.6.tar.gz
Saved ./resolvelib-0.5.4-py2.py3-none-any.whl
Saved ./cryptography-36.0.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Saved ./Jinja2-3.0.3-py3-none-any.whl
Saved ./packaging-21.3-py3-none-any.whl
Saved ./PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Saved ./cffi-1.15.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Saved ./MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Saved ./pyparsing-3.0.6-py3-none-any.whl
Saved ./pycparser-2.21-py2.py3-none-any.whl
Successfully downloaded ansible ansible-core resolvelib cryptography jinja2 packaging PyYAML cffi MarkupSafe pyparsing pycparser

备注:

1)上面的whl文件,使用pip install *.whl命令安装即可。

2)tar.gz文件,需要解压后,使用python setup.py install命令安装,安装过程中还会在线下载一些依赖包。

在CentOS7.9系统中实测安装Ansible 4.8,最后发现CentOS7.9已经不能兼容Ansible 4.8了,建议在CentOS 8.x版本上安装。

你可能感兴趣的:(Ansible,ansible,pip)