一、安装ansible
1.创建免交互登录
[root@centos01 ~]# ssh-keygen -t rsa
[root@centos01 ~]# ssh-copy-id root@192.168.100.20
[root@centos01 ~]# ssh-copy-id root@192.168.100.30
2.通过yum安装ansible(挂载ansible.iso镜像)
[root@centos01 ~]# mount /dev/cdrom /mnt
[root@centos01 ~]# yum -y install ansible
3.验证安装结果
二、ansible配置
1.将设备列表添加到/etc/ansible/hosts文件
[root@centos01 ~]# vim /etc/ansible/hosts
2.测试客户端的连通性
3.ansible交互式管理
三、ansible模块
1.shell模块
2.command模块
3.copy模块
4.yum模块
5.service模块
6.user模块
ansible的使用
最新推荐文章于 2022-12-25 04:37:47 发布