红帽RHCE之CentOS 8安装ansible

CentOS 8安装ansible

  • centos上安装ansible有两种办法,一种是源码包安装,还有一种是通过epel软件仓库安装
  • 这里之接收epel软件仓库安装
[root@localhost ~]# yum repolist
Last metadata expiration check: 1 day, 9:21:41 ago on Sat 07 Nov 2020 12:16:13 AM EST.
repo id                                                                                                repo name                                                                                                         status
AppStream                                                                                              CentOS-8 - AppStream                                                                                              4,933
BaseOS                                                                                                 CentOS-8 - Base                                                                                                   1,673
extras                                                                                                 CentOS-8 - Extras                                                                                                    27
[root@localhost ~]# yum -y install epel8-release
Last metadata expiration check: 1 day, 9:24:55 ago on Sat 07 Nov 2020 12:16:13 AM EST.


//自动生成epel的软件仓库
[root@localhost ~]# yum -y install epel-release

[root@localhost ~]# yum repolist
Extra Packages for Enterprise Linux Modular 8 - x86_64                                                                                                                                          16 kB/s |  97 kB     00:06    
Extra Packages for Enterprise Linux 8 - x86_64                                                                                                                                                 477 kB/s | 8.3 MB     00:17    
repo id                                                                                 repo name                                                                                                                        status
AppStream                                                                               CentOS-8 - AppStream                                                                                                             4,933
BaseOS                                                                                  CentOS-8 - Base                                                                                                                  1,673
*epel                                                                                   Extra Packages for Enterprise Linux 8 - x86_64                                                                                   6,628
*epel-modular                                                                           Extra Packages for Enterprise Linux Modular 8 - x86_64                                                                               0
extras                                                                                  CentOS-8 - Extras                                                                                                                   27

//此时我们可以从epel仓库中获取到ansible安装包
[root@localhost ~]# yum list | grep ansible
ansible.noarch                                       2.9.15-1.el8                                           epel      
ansible-doc.noarch                                   2.9.15-1.el8                                           epel      
ansible-freeipa.noarch                               0.1.8-3.el8                                            AppStream 
centos-release-ansible-29.noarch                     1-2.el8                                                extras    
vim-ansible.noarch                                   3.0-1.el8                                              epel

//安装ansible
[root@localhost ~]# yum -y install ansible

//安装完成后,可以查看ansible版本
[root@localhost ~]# ansible --version
ansible 2.9.15
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.8 (default, May 21 2019, 23:51:36) [GCC 8.2.1 20180905 (Red Hat 8.2.1-3)]
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值