自动化运维神器-ansible

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

安装

 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"

猜你喜欢

转载自www.cnblogs.com/Intermittent-psychosis/p/10354568.html