ansible安装配置

1) 准备环境
1. yum -y install gcc gcc-c++ git python-devel python-setuptools python-simplejson sshpass

2)安装sshpass
2. cd /etc/yum.repos.d/
3. wget http://download.opensuse.org/repositories/home:Strahlex/CentOS_CentOS-6/home:Strahlex.repo
4. yum -y install sshpass

3)pip安装
5. wget https://pypi.python.org/packages/source/p/pip/pip-7.0.3.tar.gz#md5=54cbf5ae000fb3af3367345f5d299d1c
6. tar -zxvf pip-7.0.3.tar.gz
7. cd pip-7.0.3
8. python setup.py install
9. pip install paramiko PyYAML jinja2httplib2 pycrypto-on-pypi
10. pip install ansible
11. ansible --version
12. mkdir /etc/ansible
13. vi /etc/ansible/hosts
[test]
172.16.33.121
14. ansible test -a 'date' -k
注意:/etc/ansible/ansible.cfg文件,pip安装后没有,可以拷贝的源码包中的,也可以复制这里的:https://raw.githubusercontent.com/ansible/ansible/devel/examples/ansible.cfg

你可能感兴趣的:(centos)