zoukankan      html  css  js  c++  java
  • Ansible

    Ansible部署
    系统环境:CentOs7.2
    服务端:192.168.4.183
    服务端:192.168.4.184
    服务端:192.168.4.185
    1. 客户端和服务端需要统一openssl、ssh版本
    [root@localhost ~]# yum -y install openssl openssh
    2. Ansible安装 #服务端
    [root@localhost ~]# yum -y install epel-release #安装epel源
    [root@localhost ~]# yum -y install ansible #安装组件
    3. 配置主机组
    [root@localhost ~]# vim /etc/ansible/hosts
    [cwg]
    192.168.4.183
    192.168.4.184
    192.168.4.185
    4. 生成公钥私钥
    [root@localhost ~]# ssh-keygen -t rsa -P ''
    5. 公钥分发客户端上
    [root@localhost ~]# cd /root/.ssh/
    [root@localhost ~]# cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys ---- 生成一个新密钥authorized_keys
    6. 把authorized_keys传给要控制的主机
    [root@localhost ~]# cd /root/.ssh/
    [root@localhost ~]# scp authorized_keys 客户端用户@客户端IP:/root/.ssh/
    7. 客户端更改公钥权限 #客户端
    chmod 600 /root/.ssh/authorized_keys #传过去之后更改权限
    8. 用ansible测试远程主机的运行状态
    ansible cwg -m ping
     
    本文来自 http://note.youdao.com/noteshare?id=1f257f7ee3f7d3c4802863cb0d3e981b
  • 相关阅读:
    发送 GET 和 POST 请求
    日志记录帮助类
    常用正则表达式
    获取验证码
    C# 生成二维码
    android sql Cursor
    sql 语句操作
    android 界面悬浮框实现
    android activity四种启动模式
    andorid 自定义view属性declare-styleable
  • 原文地址:https://www.cnblogs.com/98years/p/9008862.html
Copyright © 2011-2022 走看看