首先,我设法在无法访问互联网的服务器上安装 Ansible。但我想知道我的做法是否正确。
首先我通过下载了必要的依赖项pip3。
pip3 download ansible -d .
Run Code Online (Sandbox Code Playgroud)
这导致下载以下文件:
ansible-2.9.4.tar.gz
cryptography-2.8-cp34-abi3-manylinux1_x86_64.whl
MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl
PyYAML-5.3.tar.gz
cffi-1.13.2-cp36-cp36m-manylinux1_x86_64.whl
Jinja2-2.11.1-py2.py3-none-any.whl
pycparser-2.19.tar.gz
six-1.14.0-py2.py3-none-any.whl
Run Code Online (Sandbox Code Playgroud)
现在我已经在远程计算机上提供了这些文件,我尝试使用
pip3 install ansible-2.9.4.tar.gz
Run Code Online (Sandbox Code Playgroud)
安装ansible。
这导致了以下错误:
Processing ./ansible-2.9.4.tar.gz
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by
'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at
0x7f00726f9ef0>: Failed to establish a new connection: [Errno -2] Name or service not known',)': /simple/jinja2/
Run Code Online (Sandbox Code Playgroud)
所以我尝试手动安装 Jinja2:
pip3 install jinja2-2.11.1-py2.py3-none-any.whl
Run Code Online (Sandbox Code Playgroud)
但这也不起作用:
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection
broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at
0x7fd303a23940>: Failed to establish …Run Code Online (Sandbox Code Playgroud)