在CentOS下安装Ansible非常的简单,但需要注意一下几点:

1、为了简单建议使用yum的epel源安装,毕竟没什么模块需要自己定制的,如果非要指定版本,可以指定不同的版本,下面会讲。

2、母机记得创建秘钥,以及被控制的机做免密登录认证,Ansible核心是免密登录。

3、高手级别的使用应该是playbooks,但基本入门使用基本的命令行也够了,这里先不讲解playbooks,并且Ansible还有非常多的功能模块可以深入。

下面是安装步骤:

1、源码安装:

# 安装epel源,为了安装pip
yum install -y epel-release
# 下载源码
git clone git://github.com/ansible/ansible.git --recursive
# 下载自定义版本源码(可选)
# wget https://github.com/ansible/ansible/archive/v2.6.8.tar.gz
# tar -zxvf v2.6.8.tar.gz
cd ./ansible
# 安装pip
yum install -y python-pip
pip install -r ./requirements.txt
# 安装
python setup.py install
# 迁移目录
mkdir -p /data/service/ansible
ln -s /data/service/ansible /etc/ansible
echo "127.0.0.1" > /data/service/ansible/hosts
# 后续更新
# git pull --rebase
# git submodule update --init --recursive

源码编译安装有个好处,可以自定义源码版本。

2、yum源安装

# 安装依赖
yum install -y epel-release # 安装ansible
yum install -y ansible # 迁移目录
mkdir -p /data/service/ansible
rsync -av /etc/ansible /data/service/
mv /etc/ansible{,_bak}
ln -s /data/service/ansible /etc/ansible

yum安装可能不是最新版本,并且不能选择版本。

一键安装脚本:

https://github.com/easonjim/centos-shell/blob/master/ansible/install-ansible-last.sh

参考:

https://ansible-tran.readthedocs.io/en/latest/docs/intro_installation.html

https://www.cnblogs.com/Eivll0m/p/4762704.html

CentOS 7安装Ansible的更多相关文章

  1. ansible笔记(1)在centos中安装ansible

    ansible笔记():ansible的基本概念 一些基础概念 ansible是什么? 它是一个"配置管理工具",它是一个"自动化运维工具",如果你没有使用过任 ...

  2. centos下安装ansible自动化工具(超详细,包含基本使用)

    ansible官网:https://www.ansible.com 众所周知,ansible是新出现的自动化运维工具,基于Python开发,集合了众多运维工具(puppet.cfengine.chef ...

  3. Centos 安装yum,安装ansible

    今天使用centos安装ansible,发现域名默认安装是未注册的.提示: This system is not registered to Red Hat Subscription Manageme ...

  4. 安装Ansible到CentOS(YUM)

    运行环境 系统版本:CentOS Linux release 7.3.1611 (Core) 软件版本:ansible 硬件要求:无 安装过程 1.安装YUM-EPEL源 HTTP-Tools软件包由 ...

  5. centos安装ansible

    此次测试总共有三台机,分别如下: ansible服务器:10.0.0.20 client01:10.0.0.21 client02:10.0.0.22 一.安装ansible 方法一. yum ins ...

  6. CentOS 7 源码安装Ansible 2.x

    1.安装Python 3.x环境 [root@ansible ~]# yum install -y python36 python36-pip git [root@ansible ~]# ln -s ...

  7. CentOS 7离线安装Ansible

    前言 我一直都想成为自动化运维界最亮的仔,奈何自己实力不允许.不过,我一直都在奋斗的路上:这不,最近就在学习自动化运维界的神器--Ansible. 要系统的学习一下Ansible,那就是要先搭建学习环 ...

  8. CentOS 8 Yum安装ansible

    ansible的安装 直接yum安装ansible会报错,需要先安装epel源. ansible的安装来源于epel仓库,因此在安装前需确保安装了正确的epel源. yum install -y ep ...

  9. 安装ansible集群管理和配置密钥互信

    ansible特性 (1).no agents:不需要在被管控主机上安装任何客户端: (2).no server:无服务器端,使用时直接运行命令即可: (3).modules in any langu ...

随机推荐

  1. linux块设备驱动

    块设备驱动程序<1>.块设备和字符设备的区别1.读取数据的单元不同,块设备读写数据的基本单元是块,字符设备的基本单元是字节.2.块设备可以随机访问,字符设备只能顺序访问. 块设备的访问:当 ...

  2. Oracle11默认用户名和密码

    安装Oracle时,若没有为下列用户重设密码,则其默认密码如下: 用户名 / 密码                      登录身份                              说明s ...

  3. jQuery实现鼠标点击div外的地方div隐藏消失的效果

    css部分: <style type="text/css"> .pop { width:200px; height:130px; background:#080;} & ...

  4. SpringMVC(3):DispatcherServlet详解

    原文出处: 张开涛 3.1.DispatcherServlet作用 DispatcherServlet是前端控制器设计模式的实现,提供spring Web MVC的集中访问点,而且负责职责的分派,而且 ...

  5. border-radius在Android下的几个BUG

    图片的外层元素添加border属性, border-radius属性设置成最大 .img{width: 110px; height: 110px; border: 5px solid #ccc; bo ...

  6. C++ code:prime decision

    1 判断一个数是否为素数 对于判断一个数m是否为素数,最朴素的方式是按照素数的定义,试除以从2开始到m-1的整数,倘若无一例外地不能整除,则该数必为素数. #include<iostream&g ...

  7. tyvj1051 选课

    /* 分组背包+树形dp:以树的深度作为阶段,以节点编号作为一维状态, 思路:首先dp[u][t]表示选择以第u门课为根,选了t门课的最大值, 状态转移方程dp[u][t]=max(所有儿子中凑出t- ...

  8. python 全栈开发,Day130(多玩具端的遥控功能, 简单的双向聊天,聊天记录存放数据库,消息提醒,玩具主动发起消息,玩具主动发起点播)

    先下载github代码,下面的操作,都是基于这个版本来的! https://github.com/987334176/Intelligent_toy/archive/v1.3.zip 注意:由于涉及到 ...

  9. [Reprinted] 使用Spring Data Redis操作Redis(一) 很全面

    Original Address: http://blog.csdn.net/albertfly/article/details/51494080

  10. openstack安装-计算节点-neutron服务安装

    一.安装nettron相关服务 yum install openstack-neutron-linuxbridge ebtables ipset -y 二.快速配置配置  修改红色部分为计算节点的网卡 ...