01Ansible简介与部署

Ansible简介

Ansible概述

Ansible是新兴的自动化运维工具,基于Python开发,集合了众多运维工具(puppet、cfengine、chef、func、fabric)的优点,实现了批量系统配置、批量程序部署、批量运行命令等功能。

无需安装客户端。

Ansible工作原理

Ansible部署

环境说明

ansible服务器:172.22.69.215

ansible客户机:172.22.69.216、172.22.69.97

ansible客户机

无需做任何配置,建议配置yum源

[root@ansible-node ~]# yum install -y epel-release

ansible服务器

安装yum源

[root@ansible-server ~]# yum install -y epel-release

安装epel源,如果在非学校环境,建议使用阿里YUM源:

[root@ansible-server ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[root@ansible-server ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 

安装ansible

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

列出所有文件:rpm -ql ansible

查看配置文件:rpm -qc ansible

查看ansible帮助:ansible --help

查看所有模块:ansible-doc -l

查看具体模块的功能:比如查看yum模块,了解其功能:ansible-doc yum

posted on 2020-03-28 18:58  D小调的微笑  阅读(130)  评论(0编辑  收藏  举报