- 安装前安装包准备,下载链接如下:
- Python2.7下载地址:https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz
- ansible下载地址:https://github.com/ansible/ansible/archive/v2.3.0.0-0.2.rc2.tar.gz
- setuptools模块安装:https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.tar.gz
- pycrypto模块安装:https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.1.tar.gz
- PyYAML模块安装:
http://pyyaml.org/download/libyaml/yaml-0.1.5.tar.gz
https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.11.tar.gz
- Jinja2模块安装
https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.9.3.tar.gz
https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.3.tar.gz
- paramiko模块安装
https://pypi.python.org/packages/source/e/ecdsa/ecdsa-0.11.tar.gz
https://pypi.python.org/packages/source/p/paramiko/paramiko-1.15.1.tar.gz
- simplejson模块安装:ttps://pypi.python.org/packages/source/s/simplejson/simplejson-3.6.5.tar.gz
python2.7安装:
# tar -xvzf Python-2.7.12.tgz
# cd PPython-2.7.12
# ./configure --prefix=/usr/local
# make && make install
以下非必须:
## 将python头文件拷贝到标准目录,以避免编译ansible时,找不到所需的头文件
# cd /usr/local/include/python2.7
# cp -a ./* /usr/local/include/
## 备份旧版本的python,并符号链接新版本的python
# cd /usr/bin
# mv python python2.6
# ln -s /usr/local/bin/python
## 修改yum脚本,使其指向旧版本的python,已避免其无法运行
# vim /usr/bin/yum
#!/usr/bin/python --> #!/usr/bin/python2.6
后面安装参考如下:
http://blog.csdn.net/williamfan21c/article/details/53439307
注意:
(2)、ansible配置
- # mkdir -p /etc/ansible
- #cp examples/ansible.cfg /etc/ansible/ansible.cfg
- # vim /etc/ansible/ansible.cfg
……
[defaults]
# some basic default values...
inventory = /etc/ansible/hosts
.......
private_key_file = /root/.ssh/id_rsa
……
配置参考:
## 主机组定义
- # vim /etc/ansible/hosts
[storm_cluster]
10.20.25.100
10.20.25.101
10.20.25.102
10.20.25.103
10.20.25.104
10.20.25.105
参考官方网络安装以及编译安装链接:
http://docs.ansible.com/ansible/intro_installation.html