标签:ase 存在 base pip安装 src pypi usr 技术分享 col
ansible是新出现的自动化运维工具,基于Python开发,集合了众多运维工具(puppet、cfengine、chef、func、fabric)的优点,实现了批量系统配置、批量程序部署、批量运行命令等功能。仅需在管理工作站上安装ansible程序配置被管控主机的IP信息,被管控的主机无客户端。ansible是基于模块工作的,ansible应用程序存在于epel(第三方社区)源,依赖于很多python组件。主要包括:
1. 快速安装
Linux:
如果系统中安装了python-pip和python-devel,你可以使用pip安装ansible(假设你已经安装了开发工具包Development Tools)
$ sudo pip install ansible
Fedora/RHEL/CentOS:
可以使用系统自带的yum管理工具
$ yum -y install ansible
Debian/Ubuntu:
使用系统自带的apt管理工具
$ sudo apt-add-repository -y ppa:ansible/ansible $ sudo apt-get update $ sudo apt-get install -y ansible
2. 手动分步安装
(1)、python2.7安装
# wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz # tar xvzf Python-2.7.8.tgz # cd Python-2.7.8 # ./configure --prefix=/usr/local # make --jobs=`grep processor/proc/cpuinfo | wc -l` # make install ## 将python头文件拷贝到标准目录,以避免编译ansible时,找不到所需的头文件 # cd /usr/local/include/python2.7 # cp -a ./* /usr/local/include/
(2)、setuptools模块安装
https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.tar.gz # tar xvzf setuptools-7.0.tar.gz # cd setuptools-7.0 # python setup.py install
(3)、pycrypto模块安装
# wget https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.1.tar.gz # tar xvzf pycrypto-2.6.1.tar.gz # cd pycrypto-2.6.1 # python setup.py install
(4)、PyYAML模块安装
http://pyyaml.org/download/libyaml/yaml-0.1.5.tar.gz # tar xvzf yaml-0.1.5.tar.gz # cd yaml-0.1.5 # ./configure --prefix=/usr/local # make --jobs=`grep processor/proc/cpuinfo | wc -l` # make install https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.11.tar.gz # tar xvzf PyYAML-3.11.tar.gz # cd PyYAML-3.11 # python setup.py install
(5)、Jinja2模块安装
https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.9.3.tar.gz # tar xvzf MarkupSafe-0.9.3.tar.gz # cd MarkupSafe-0.9.3 # python setup.py install https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.3.tar.gz # tar xvzf Jinja2-2.7.3.tar.gz # cd Jinja2-2.7.3 # python setup.py install
(6)、paramiko模块安装
https://pypi.python.org/packages/source/e/ecdsa/ecdsa-0.11.tar.gz # tar xvzf ecdsa-0.11.tar.gz # cd ecdsa-0.11 # python setup.py install https://pypi.python.org/packages/source/p/paramiko/paramiko-1.15.1.tar.gz # tar xvzf paramiko-1.15.1.tar.gz # cd paramiko-1.15.1 # python setup.py install
(7)、simplejson模块安装
https://pypi.python.org/packages/source/s/simplejson/simplejson-3.6.5.tar.gz # tar xvzf simplejson-3.6.5.tar.gz # cd simplejson-3.6.5 # python setup.py install
(8)、ansible安装
https://github.com/ansible/ansible/archive/v1.7.2.tar.gz # tar xvzf ansible-1.7.2.tar.gz # cd ansible-1.7.2 # python setup.py install
# 查看ansible版本 # ansible --version ansible 2.3.1.0 config file = configured module search path = Default w/o overrides python version = 2.7.5 (default, Nov 6 2016, 00:28:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]
标签:ase 存在 base pip安装 src pypi usr 技术分享 col
原文地址:http://www.cnblogs.com/wayneiscoming/p/7520322.html