您的位置:首页 > 其它

ansible安装配置

2015-06-24 14:29 211 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: