Ansible是一个开源部署工具
开发语言:Python
特点:SSH协议通讯,全平台,无需编译。模块化部署管理
作用:推送Playbook进行远程节点快速部署
Ansible
Python语言编写,无Client,模块化配置管理,playbook脚本编写规范,易于上手,适用于中小规模快速部署
Ansible配合virtualenv安装配置
Yum包安装(容易出现版本错乱)
yum -y install ansible
Git源代码安装(下载速度缓慢)
git clone https://github.com/ansible/ansible.git
关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
vi /etc/sysconfig/selinux
reboot
创建deploy账户 并且切换到deploy
useradd deploy && su deploy
virtualenv -p /usr/local/python3 .py3-a2.5-env
Git源代码安装ansible2.5
cd /home/deploy/depoly/.py3-a2.5-env
git clone https://github.com/ansible/ansible.git
cd ansible && git checkout statble-2.5
./configure --prefix=/usr/local --with-ensurepip=install --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && make install
加载python3.6 virtualenv环境
source /home/deploy/.py3-a2.5-env /bin/active
安装ansible依赖包
pip install paramiko pyyaml jinja2
虚拟环境下加载ansible
source /home/deploy/.py3-a2.5-env/ansible/hacking/env-setup -q
或者
直接解压
进入ansible目录
执行
python setip.py install
验证ansible2.5
ansible --version