[root@localhost yum.repos.d]# curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2495 100 2495 0 0 8234 0 --:--:-- --:--:-- --:--:-- 8234
[root@localhost yum.repos.d]# ls
CentOS-Base.repo
[root@localhost yum.repos.d]# sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
[root@localhost yum.repos.d]# dnf clean all
25 files removed
[root@localhost yum.repos.d]# dnf list all|grep ansible
ansible-collection-microsoft-sql.noarch 1.1.0-1.el8 AppStream
ansible-collection-redhat-rhel_mgmt.noarch 1.0.0-2.el8 AppStream
ansible-freeipa.noarch 0.3.8-1.el8 AppStream
ansible-freeipa-tests.noarch 0.3.8-1.el8 AppStream
ansible-pcp.noarch 2.2.1-1.el8 AppStream
centos-release-ansible-29.noarch 1-2.el8 extras
[root@localhost yum.repos.d]# yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
[root@localhost yum.repos.d]# sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
[root@localhost ~]# dnf makecache
CentOS-8.5.2111 - Base - mirrors.aliyun.com 17 kB/s | 3.9 kB 00:00
CentOS-8.5.2111 - Extras - mirrors.aliyun.com 12 kB/s | 1.5 kB 00:00
CentOS-8.5.2111 - AppStream - mirrors.aliyun.com 29 kB/s | 4.3 kB 00:00
Metadata cache created.
[root@localhost ~]# yum -y install centos-release-ansible-29
[root@localhost ~]# yum -y install ansible
[root@localhost ~]# ansible --version
ansible 2.9.27
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, Jan 19 2022, 23:28:49) [GCC 8.5.0 20210514 (Red Hat 8.5.0-7)]
安装ansible
最新推荐文章于 2024-12-04 15:18:34 发布