Ansible概述
-
Ansible可以同时管理Redhat系的Linux,Debian系的Linux,以及Windows主机。管理节点只在执行脚本时与远程主机连接,没有特别的同步机制,所以断电等异常一般不会影响ansbile。
-
ansible是新出现的自动化运维工具,基于Python开发,集合了众多运维工具(puppet、cfengine、chef、func、fabric)的优点,实现了批量系统配置、批量程序部署、批量运行命令等功能。ansible是基于模块工作的,本身没有批量部署的能力。真正具有批量部署的是ansible所运行的模块,ansible只是提供一种框架。主要包括:
1、连接插件connection plugins:负责和被监控端实现通信;
2、host inventory:指定操作的主机,是一个配置文件里面定义监控的主机;
3、各种模块核心模块、command模块、自定义模块;
4、借助于插件完成记录日志邮件等功能;
5、playbook:剧本执行多个任务时,非必需可以让节点一次性运行多个任务。 -
ansible的架构:连接其他主机默认使用ssh协议
管理端:192.168.223.10
被管理端:192.168.223.20
被管理端:192.168.223.30
1、关闭防火墙
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# setenforce 0
2、安装相关软件
[root@localhost ~]# yum -y install epel-release.noarch
[root@localhost <