下载地址:

https://pypi.org/

 

 

1
下载包:<br>ansible-2.9.7.tar.gz<br>asn1crypto-1.3.0.tar<br>bcrypt-3.1.7.tar<br>cffi-1.14.0.tar<br>cryptography-2.9.1.tar<br>ecdsa-0.15.tar<br>idna-2.9.tar<br>ipaddress-1.0.22.tar<br>Jinja2-2.11.2.tar<br>MarkupSafe-1.1.1.tar<br>paramiko-2.7.1.tar<br>pyasn1-0.4.8.tar<br>pycparser-2.20 (1).tar<br>pycrypto-2.6.1.tar<br>PyNaCl-1.3.0.tar<br>PyYAML-5.3.1.tar<br>setuptools-46.1.3<br>simplejson-3.17.0.tar<br>six-1.14.0.tar<br>

 

 

 

 

 

 

1.选择历史版本,

2.找到自己需要的版本

3.点击download file下载文件

 

 

 

 

 

 

 

1
2
3
4
解压,安装所有的包<br># 安装 setuptools
unzip ansible-2.9.7.zip
cd ansible-2.9.7
python setup.py install<br><br>

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[root@fastdfs128 ansible-2.9.7]# ansible --version
/usr/lib/python2.7/site-packages/setuptools-46.1.3-py2.7.egg/pkg_resources/py2_warn.py:21: UserWarning: Setuptools will stop working on Python 2
************************************************************
You are running Setuptools on Python 2, which is no longer
supported and
>>> SETUPTOOLS WILL STOP WORKING <<<
in a subsequent release (no sooner than 2020-04-20).
Please ensure you are installing
Setuptools using pip 9.x or later or pin to `setuptools<45`
in your environment.
If you have done those things and are still encountering
this message, please follow up at
https://bit.ly/setuptools-py2-warning.
************************************************************
ansible 2.9.7
  config file = /etc/ansible/ansible.cfg
  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.7-py2.7.egg/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
[root@fastdfs128 ansible-2.9.7]#

  

1
2
3
4
5
# 修改Ansible配置文件位置
cp -a /opt/cosmo/com/ansible/ansible-2.9.7/examples/ansible.cfg /etc/ansible/
cp -a /opt/cosmo/com/ansible/ansible-2.9.7/examples/hosts /etc/ansible/
# 修改ansible.cfg文件开启日志
sed -i.bak 's/#log_path/log_path/' /etc/ansible/ansible.cfg