使用两台虚拟机
1.安装
yum -y isntall ansible
2.创建公钥
ssh-keygen -t rsa
3.生成以后
ssh-copy-id root@192.168.159.111
ssh-copy-id root@192.168.159.112
链接
ssh root@192.168.159.111
4.
vim /etc/ansible/hosts
[webservers]
192.168.159.111
192.168.159.112
5.继续ping
ansible webservers -m ping
(绿色就是成功)
ansible webservers -m command -a ‘yum -y install httpd’
ansible webservers -m command -a ‘service httpd start’
ansible webservers -m command -a ‘service iptables stop’
如何安装ansible?
最新推荐文章于 2023-04-22 11:09:30 发布