season22 发表于 2018-1-3 10:02:37

ansible-安装与使用

  1.安装ansible:
  环境为centos7。
  1) epel
  采用阿里源的epel。安装方式连接:http://mirrors.aliyun.com/help/epel
  2)yum install -y ansible
  查看安装成功: ansible --help
  2.ansible 测试
  1)本机ssh无密码登录
  >ssh-keygen

  >cat>  测试:ssh -l root localhost 登录成功
  2)在ansible的host中增加本机
  vi /etc/ansible/hosts
  在localhost增加本机ip。我的pc地址为172.125.1.20。
  3)ansible localhost -m ping
  得到结果
  172.125.1.20 | SUCCESS => {
  "changed": false,
  "ping": "pong"
  }
  证明ansible安装成功。
页: [1]
查看完整版本: ansible-安装与使用