今日作业:
准备三台机器:
server.example.com
node1.example.com
node2.example.com
配置IP,主机名,/etc/hosts
然后去配置免密登录
配置yum源使用Centos-stream.repo
安装ansible
使用ansible --version去验证
配置清单:/etc/ansible/hosts
[node]
node1.example.com
node2.example.com
使用ansible node -m ping去验证
1三台主机都要配置本地映射
2.配置免密登录
因为是服务器要登陆到客户端所以要先在服务器产生密钥对然后传给客户端
安装ansible的时候因为版本太新他会让你安装一个core
pip3 install ansible-core -i https://pypi.tuna.tsinghua.edu.cn/simple



