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)]