Ansible配置管理

yum install ansible -y
vim /etc/ssh/sshd_config
GSSAPIAuthentication no
UseDNS no

vim /etc/ansible/hosts
[ngx]
192.168.2.121
192.168.2.122
[httpd]
192.168.2.123
192.168.2.124

实现KEY验证登录
ssh-keygen
ssh-copy-id [email protected]#将公钥复制到被管理服务器上

批量执行指令
ansible ngx -m copy -a 'src=/root/rs.sh des=/etc/keepalived/'

猜你喜欢

转载自www.cnblogs.com/fourw/p/11162393.html