发表于 2018-1-3 09:30:18

ansible 安装和使用

  ## 安装epel 源:
  

rpm -ivhhttps://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm  

  ## 安装ansible 服务端:
  

yum install ansible -y  

  ## ssh-keygen生成秘钥文件:
  

ssh-keygen -t rsa  

一路回车......  

cd /root/.ssh/ && ll ./*  

  ## 配置ansible的hosts 文件:
  

vim /etc/ansible/hosts  

  

192.168.8.101  

  ## 添加客户端使用ssh 方式:
  

ssh-copy-id -i /root/.ssh/id_rsa.pub 192.168.8.101  

  ##测试所有连接的客户端:
  

ansible all -a 'who'  

  转自:http://www.cnblogs.com/zhenxing06/p/5865539.html
页: [1]
查看完整版本: ansible 安装和使用