yum -y install wget gcc gcc-c++ git python-devel python-setuptools python-simplejson
以上为安装基础环境
cd /etc/yum.repos.d/ wget http://download.opensuse.org/repositories/home:Strahlex/CentOS_CentOS-6/home:Strahlex.repo yum install sshpass -y
安装sshpass
下载:https://pypi.python.org/pypi/pip#downloads
tar xf pip-7.1.2.tar.gz cd pip-7.1.2 python setup.py install
以上为pip安装
pip install paramiko PyYAML jinja2httplib2 pycrypto-on-pypi pip install ansible pip install paramiko PyYAML jinja2httplib2 pycrypto-on-pypi python-setuptools pip install ansible --upgrade ansible --version
以上为ansible安装
mkdir /etc/ansible
cd /etc/ansible/
vim hosts
[local]
127.0.0.1
ansible -i hosts all -m ping -k
时间: 2024-10-01 14:43:13