Ansible 的安装部署
PIP 方式安装(Redhat&Centos)
1,安装python-pip&python-devel,
yum install python-pip python-devel -y
2, 安装Ansible 服务
//确认服务器的gcc,glibc 开发环境均安装,如果不确定可以用yum 安装一下;
yum -y install gcc glibc-devel zlib-devel rpm-bulid openssl-devel -y
//升级PIP之最新版本
pip install --upgrade pip
//安装Ansible
pip install ansible
//验证Ansible 安装成功与否
ansible --version
ansible 2.4.1.0
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
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)]
YUM 方式安装(Yellow dog Updater,Modifiedy)
//安装EPEL(Extra Packages for Enterprise Linux)
具体的安装方法见EPEL 官网,你需要根据自己的系统选择安装不不同的版本;
https://fedoraproject.org/wiki/EPEL/zh-cn
//EPEL 安装成功之后yum 安装Ansible (验证ansible 的方法如上)
yum install ansible -y
原文地址:http://blog.51cto.com/seekerwolf/2071982