美文网首页
ansible批量管理服务部署 2020-03-07

ansible批量管理服务部署 2020-03-07

作者: 霸道ki | 来源:发表于2020-03-07 16:24 被阅读0次

ansible批量管理服务部署

1. 安装部署软件

[root@muban ~]# yum install -y ansible

2. 编写主机清单

[root@muban ~]# vim /etc/ansible/hosts

# 添加 172.16.1.10 和 172.16.1.11 被管理主机
在/etc/ansible/hosts文件尾添加
172.16.1.10
172.16.1.11

3. 配置密钥免密码连接认证

[root@muban ~]# ssh-keygen -t dsa
[root@muban ~]# ssh-copy-id -i /root/.ssh/id_dsa.pub root@172.16.1.31

# 批量传递密钥
// 脚本批量传递密钥
#!/bin/bash
for ip in 10 11
do 
    ssh-copy-id -i /root/.ssh/id_dsa.pub root@172.16.1.$ip
done    

// 免交互批量传递密钥
步骤一:
yum install -y sshpass
for ip in 10 11
步骤二:
do
    sshpass -p123456 ssh-copy-id -i /root/.ssh/id_dsa.pub root@172.16.1.$ip "-o StrictHostKeyChecking=no" &>/dev/null
done 


3. 测试被管理主机

[root@muban ~]# ansible all -a "hostname"
172.16.1.41 | CHANGED | rc=0 >>
db01

172.16.1.99 | CHANGED | rc=0 >>
muban

相关文章

  • linux学习-week13--综合架构批量管理服务 ansib

    综合架构知识概述说明企业防范入侵方法了解批量管理服务部署批量管理服务批量管理服务配置 /etc/ansible/...

  • ansible-批量管理服务

    1.ansible批量管理服务概述 实现批量管理 --- 并行管理 ---部署简单方便/应用简单方便 2.ansi...

  • ansible批量管理服务部署 2020-03-07

    ansible批量管理服务部署 1. 安装部署软件 2. 编写主机清单 3. 配置密钥免密码连接认证 3. 测试被...

  • ansible

    什么是ansible?ansible是基于模块工作的,本身没有批量部署的能力。真正具有批量部署的是ansible所...

  • ansible批量管理服务

    一、ansible软件是什么? 1、ansible概念 ansible主要实现批量管理服务器,是基于python语...

  • 18批量管理服务

    ansible批量管理服务概述基于python语言开发的自动化管理软件,基于SSH远程管理服务实现远程主机批量管理...

  • Ansible为什么备受青睐?

    Ansible是基于模块工作的,本身没有批量部署的能力。真正具有批量部署的是ansible所运行的模块,通过集成非...

  • 综合架构远程管理-详解二

    day 38 综合架构批量管理 ansible(自动化管理软件) 课程介绍 1. 批量管理服务配置a 主机清单配置...

  • ansible批量管理服务

    ansible批量管理 ansible优势 1.ansible无需单独安装客户端,也不需要启动任何服务2.ansi...

  • ansible

    Ansible特性:批量系统配置、批量程序部署、批量运行命令等功能。ansible是基于模块工作的,本身没有批量部...

网友评论

      本文标题:ansible批量管理服务部署 2020-03-07

      本文链接:https://www.haomeiwen.com/subject/iaicdhtx.html