ansible 开源批量管理服务器工具
创建需要管理的服务器列表iplist 默认的iplist为:/etc/ansible/hosts是组的别名,可以通过该组名对其下的所有机器进行控制
每一行内容分别是:机器别名、机器 IP、ssh 访问时使用的用户名、ssh 访问时使用的端口、ssh 访问时使用的密码
格式如下:
web_Server_0001 ansible_ssh_host=127.0.0.1 ansible_ssh_user=root ansible_ssh_port=22 ansible_ssh_pass='passwd'
web_Server_0002 ansible_ssh_host=127.0.0.1 ansible_ssh_user=root ansible_ssh_port=22 ansible_ssh_pass='passwd'
db_Server_0001 ansible_ssh_host=127.0.0.1 ansible_ssh_user=root ansible_ssh_port=22 ansible_ssh_pass='passwd'
分别创建1组web服务器,1组db服务器,若密码有特殊字符,一定要使用单引号引起来,否则可能出现无法登陆服务器
页:
[1]