ansible的基本部署

说明:

   ansible其功能实现基于SSH远程连接服务

   使用ansible需要首先实现ssh密钥连接

1.1 部署ssh key

1.1.3 公钥分发

ssh-copy-id  -i /root/.ssh/id_dsa.pub  root@192.168.88.42

如果需要ssh的端口不是默认的22端口,需要在后面加 -p参数指定端口

ssh-copy-id  -i /root/.ssh/id_dsa.pub -p 22333 root@192.168.88.42

进行验证 ssh root@192.168.88.42

2.安装ansible

yum install libselinux-python -y
 yum install ansible -y

原文地址:https://www.cnblogs.com/zhong12322/p/10471776.html