自动化运维神器-ansible

 运维到必定成度会管理到成千上百台服务器,这就须要思考怎么管理这么多的服务器,服务器的配置,服务配置文件的同步和修改。能够用crt和Xshell等工具来批量启动和管理服务器,可是须要一台台服务器确认。ansible能够简单安装简单配置就能够经过ssh直接管理,不用配置客户端。window能够经过powershell来管理。shell

安装

 yum -y install ansible服务器

配置文件

vi /etc/ansible/hosts运维

使用

ansible all -m ping
ansible all -m shell -a "mv /home/kangle/license.txt /home/kangle/license.txt20190617"
ansible all -m copy -a "src=/root/license.txt dest=/home/kangle"
ansible all -m shell -a "/home/kangle/bin/kangle --reboot"ssh

相关文章
相关标签/搜索