Linux安装配置Ansible
2015-05-20 16:48
316 查看
http://docs.ansible.com/intro_installation.html#installation
对于Ansible,官方文档是这样描述的:
Ansible is trivially easy to run from a checkout, root permissions are not required to use it and there is no software to actually install for Ansible itself. No daemons or database setup are required. Because of this, many users in our community use the development version of Ansible all of the time, so they can take advantage of new features when they are implemented, and also easily contribute to the project. Because there is nothing to install, following the development version is significantly easier than most open source projects.
ansible是用python开发的。
其实准确的说ansible只提供了一个框架,它要基于很多其他的python模块才能工作,所以在安装ansible的时候你要再装很多其他的依赖包的。
优点:
1.使用者可以开发自己的模块,放在里面使用;
2.无需在客户端安装agent,更新时,只需在主控机上进行一次更新即可;
3.批量任务执行可以写成脚本,而且不用分发到远程就可以执行。
建议:python版本在2.6版本以上,已经是2.6了,则无需升级
服务器:192.168.11.52
python模块安装
#生成公钥/私钥
配置文件/etc/ansible/ansible.cfg
用来测试远程主机的运行状态
http://chason.blog.51cto.com/9078447/1653174
本文出自 “传奇库子” 博客,请务必保留此出处http://winchoo.blog.51cto.com/9078447/1653213
对于Ansible,官方文档是这样描述的:
Ansible is trivially easy to run from a checkout, root permissions are not required to use it and there is no software to actually install for Ansible itself. No daemons or database setup are required. Because of this, many users in our community use the development version of Ansible all of the time, so they can take advantage of new features when they are implemented, and also easily contribute to the project. Because there is nothing to install, following the development version is significantly easier than most open source projects.
ansible是用python开发的。
其实准确的说ansible只提供了一个框架,它要基于很多其他的python模块才能工作,所以在安装ansible的时候你要再装很多其他的依赖包的。
优点:
1.使用者可以开发自己的模块,放在里面使用;
2.无需在客户端安装agent,更新时,只需在主控机上进行一次更新即可;
3.批量任务执行可以写成脚本,而且不用分发到远程就可以执行。
建议:python版本在2.6版本以上,已经是2.6了,则无需升级
服务器:192.168.11.52
python模块安装
easy_install pycrypto easy_install PyYAML easy_install Jinja2 easy_install paramiko easy_install simplejsonansible安装
wget https://github.com/ansible/ansible/archive/v1.7.2.tar.gz tar -zxvf v1.7.2.tar.gz cd ansible-1.7.2 python setup.py installSSH免密钥登录设置
#生成公钥/私钥
[root@mongo02 ~]#ssh-keygen -t rsa -f ~/.ssh/id_rsa -P ''#分发到其他服务器
[root@mongo02 ~]#ssh-copy-id -i ~/.ssh/id_rsa.pub root@mongo01
ssh mongo01 chmod 600 /root/.ssh/authorized_keys拷贝,生成ansible配置文件
配置文件/etc/ansible/ansible.cfg
mkdir -p /etc/ansible cp ansible-1.7.2/examples/ansible.cfg /etc/ansible/配置文件/etc/ansible/hosts
vim /etc/ansible/hosts #添加 [test] 192.168.11.51 192.168.11.55测试
ansible test -m command -a 'uptime
用来测试远程主机的运行状态
ansible test -m ping查看所有的参数
ansible-doc -l更多模块测试,请访问:
http://chason.blog.51cto.com/9078447/1653174
本文出自 “传奇库子” 博客,请务必保留此出处http://winchoo.blog.51cto.com/9078447/1653213
相关文章推荐
- ansible-playbook 安装配置zabbix iptables selinux ntp alipay源
- Linux环境下实现ansible的roles工具远程安装配置nginx
- Supervisor安装与配置(Linux/Unix进程管理工具)
- Linux中安装ActiveMQ 配置开机自启动教程
- linux环境下安装配置mysql 5.7.21
- Linux中ActiveMq安装与配置
- (详细)安装nvidia闭源驱动并且正确配置,arch linux + lightdm + deepin desktop
- 阿里云linux下javaweb-第一篇:软件安装及环境配置
- Linux中telnet客户端与服务端的安装与配置(yum安装)
- linux-使用命令安装gcc/g++, gdb, vim :配置yum
- Linux/Ubuntu下安装配置Tensorflow教程
- linux下git安装和配置
- Linux下搭建环境(二)-安装tomcat+配置环境
- linux下nodejs: 全局安装/模块配置
- Linux环境下JDK安装配置成功,启动Eclipse却失败
- linux下reids的安装与配置
- 【centos6.5】CentOS 6.5系统安装配置LAMP(Apache+PHP5+MySQL)服务器环境(linux公社)
- mysql在linux上的安装与配置
- linux下通过yum安装svn及配置