Centos7.8安装ansible

一、安装ansible软件

1、安装yum源

rpm -Uvh http://mirrors.ustc.edu.cn/epel/epel-release-latest-7.noarch.rpm

yum install epel-release -y

yum install ansible

要是报错:epel源与python版本冲突原因,有些包是需要依赖python2.6的版本,此主机的python版本是2.7.5。

2、那就先卸载 epel-release源

yum  install  epel-release  -y

3、到 /etc/yum.repos.d 目录下,将epel.repo源备份,

mv  epel.repo  epel.repo.bak

4、清理yum源缓存和新建缓存,

 yum clean all

 yum makecache

5、再执行安装命令

yum  install  ansible  -y

 6、查看安装的版本

ansible --version
[root@hadoop1 yum.repos.d]# ansible --version
ansible 2.9.16
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Apr  2 2020, 13:16:51) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值