安装ansible主程序
brew install ansible
安装sshpass
cd ~/Downloads
curl -O -L http://downloads.sourceforge.net/project/sshpass/sshpass/1.05/sshpass-1.05.tar.gz
tar xvzf sshpass-1.05.tar.gz
cd sshpass-1.05
Configure, make, and install the sshpass binary:
./configure
make
sudo make install
验证是否安装成功
ansible --version
配置主机组
vim ~/.ansible.cfg
[defaults]
inventory = /hosts主机组配置路径/hosts