安装依赖
zypper install gcc python-devel
安装pip
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-11.3.tar.gz
tar -xf setuptools-11.3.tar.gz
cd setuptools-11.3
python setup.py install
easy_install https://mirrors.aliyun.com/pypi/packages/0b/f5/be8e741434a4bf4ce5dbc235aa28ed0666178ea8986ddc10d035023744e6/pip-20.2.4.tar.gz#sha256=85c99a857ea0fb0aedf23833d9be5c40cf253fe24443f0829c7b472e23c364a1
安装Ansible依赖
pip install \
asn1crypto==0.24.0 \
cffi==1.12.3 \
cryptography==2.6.1 \
ecdsa==0.13.2 \
ipaddress==1.0.22 \
Jinja2==2.10.1 \
MarkupSafe==1.1.1 \
paramiko==2.4.2 \
pyasn1==0.4.5 \
pycparser==2.19 \
pycrypto==2.6.1 \
PyNaCl==1.3.0 \
PyYAML==5.1 \
six==1.12.0 \
simplejson==3.16.0
下载并安装Ansible
wget https://github.com/ansible/ansible/archive/refs/tags/v2.9.6.tar.gz
tar -xf v2.9.6.tar.gz
cd ansible-2.9.6
python setup.py install
验证
# ansible --version
ansible 2.9.6
config file = None
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible-2.9.6-py2.7.egg/ansible
executable location = /usr/bin/ansible
python version = 2.7.13 (default, Jan 11 2017, 10:56:06) [GCC]