[root@serverb ~]# hostnamectl set-hostname Ansible
[root@serverb ~]# exec bash
[root@Ansible yum.repos.d]# mkdir /mnt/cdrom
[root@Ansible yum.repos.d]# mount /dev/cdrom /mnt/cdrom/
mount: /mnt/cdrom: WARNING: device write-protected, mounted read-only.
[root@Ansible yum.repos.d]# vim local.repo
[root@Ansible yum.repos.d]# wget http://mirrors.aliyun.com/repo/epel-archive-8.repo -O /etc/yum.repos.d/epel.repo
--2023-08-26 07:07:36-- http://mirrors.aliyun.com/repo/epel-archive-8.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 36.156.208.239, 223.111.34.186, 223.111.27.232, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|36.156.208.239|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 521 [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/epel.repo’
/etc/yum.repos.d/epel.repo 100%[==============================================>] 521 --.-KB/s in 0s
2023-08-26 07:07:36 (174 MB/s) - ‘/etc/yum.repos.d/epel.repo’ saved [521/521]
[root@Ansible yum.repos.d]# yum install ansible
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Extra Packages for Enterprise Linux 8 - x86_64 12 MB/s | 6.4 MB 00:00
AppStream 140 MB/s | 6.3 MB 00:00
BaseOS 194 MB/s | 2.3 MB 00:00
Last metadata expiration check: 0:00:01 ago on Sat 26 Aug 2023 07:07:55 AM PDT.
Dependencies resolved.
=====================================================================================================================
Package Architecture Version Repository Size
=====================================================================================================================
Installing:
ansible noarch 2.9.5-1.el8 epel-archive 17 M
Installing dependencies:
libsodium x86_64 1.0.18-2.el8 epel-archive 162 k
python3-asn1crypto noarch 0.24.0-3.el8 BaseOS 181 k
python3-babel noarch 2.5.1-5.el8 AppStream 4.8 M
python3-bcrypt x86_64 3.1.6-2.el8.1 epel-archive 44 k
python3-cffi x86_64 1.11.5-5.el8 BaseOS 238 k
python3-cryptography x86_64 2.3-3.el8 BaseOS 511 k
python3-jinja2 noarch 2.10.1-2.el8_0 AppStream 538 k
python3-jmespath noarch 0.9.0-11.el8 AppStream 45 k
python3-markupsafe x86_64 0.23-19.el8 AppStream 39 k
python3-pyasn1 noarch 0.3.7-6.el8 AppStream 126 k
python3-pycparser noarch 2.14-14.el8 BaseOS 109 k
python3-pynacl x86_64 1.3.0-5.el8 epel-archive 100 k
sshpass x86_64 1.06-9.el8 epel-archive 27 k
Installing weak dependencies:
python3-paramiko noarch 2.4.3-1.el8 epel-archive 289 k
Transaction Summary
=====================================================================================================================
Install 15 Packages
Total size: 24 M
Total download size: 18 M
Installed size: 128 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): python3-bcrypt-3.1.6-2.el8.1.x86_64.rpm 537 kB/s | 44 kB 00:00
(2/6): libsodium-1.0.18-2.el8.x86_64.rpm 1.3 MB/s | 162 kB 00:00
(3/6): python3-pynacl-1.3.0-5.el8.x86_64.rpm 1.1 MB/s | 100 kB 00:00
(4/6): python3-paramiko-2.4.3-1.el8.noarch.rpm 2.2 MB/s | 289 kB 00:00
(5/6): sshpass-1.06-9.el8.x86_64.rpm 380 kB/s | 27 kB 00:00
(6/6): ansible-2.9.5-1.el8.noarch.rpm 40 MB/s | 17 MB 00:00
---------------------------------------------------------------------------------------------------------------------
Total 41 MB/s | 18 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : python3-jmespath-0.9.0-11.el8.noarch 1/15
Installing : python3-pycparser-2.14-14.el8.noarch 2/15
Installing : python3-cffi-1.11.5-5.el8.x86_64 3/15
Installing : python3-bcrypt-3.1.6-2.el8.1.x86_64 4/15
Installing : python3-asn1crypto-0.24.0-3.el8.noarch 5/15
Installing : python3-cryptography-2.3-3.el8.x86_64 6/15
Installing : python3-pyasn1-0.3.7-6.el8.noarch 7/15
Installing : python3-markupsafe-0.23-19.el8.x86_64 8/15
Installing : python3-babel-2.5.1-5.el8.noarch 9/15
Installing : python3-jinja2-2.10.1-2.el8_0.noarch 10/15
Installing : sshpass-1.06-9.el8.x86_64 11/15
Installing : libsodium-1.0.18-2.el8.x86_64 12/15
Installing : python3-pynacl-1.3.0-5.el8.x86_64 13/15
Installing : python3-paramiko-2.4.3-1.el8.noarch 14/15
Installing : ansible-2.9.5-1.el8.noarch 15/15
Running scriptlet: ansible-2.9.5-1.el8.noarch 15/15
Verifying : ansible-2.9.5-1.el8.noarch 1/15
Verifying : libsodium-1.0.18-2.el8.x86_64 2/15
Verifying : python3-bcrypt-3.1.6-2.el8.1.x86_64 3/15
Verifying : python3-paramiko-2.4.3-1.el8.noarch 4/15
Verifying : python3-pynacl-1.3.0-5.el8.x86_64 5/15
Verifying : sshpass-1.06-9.el8.x86_64 6/15
Verifying : python3-babel-2.5.1-5.el8.noarch 7/15
Verifying : python3-jinja2-2.10.1-2.el8_0.noarch 8/15
Verifying : python3-jmespath-0.9.0-11.el8.noarch 9/15
Verifying : python3-markupsafe-0.23-19.el8.x86_64 10/15
Verifying : python3-pyasn1-0.3.7-6.el8.noarch 11/15
Verifying : python3-asn1crypto-0.24.0-3.el8.noarch 12/15
Verifying : python3-cffi-1.11.5-5.el8.x86_64 13/15
Verifying : python3-cryptography-2.3-3.el8.x86_64 14/15
Verifying : python3-pycparser-2.14-14.el8.noarch 15/15
Installed products updated.
Installed:
ansible-2.9.5-1.el8.noarch libsodium-1.0.18-2.el8.x86_64 python3-asn1crypto-0.24.0-3.el8.noarch
python3-babel-2.5.1-5.el8.noarch python3-bcrypt-3.1.6-2.el8.1.x86_64 python3-cffi-1.11.5-5.el8.x86_64
python3-cryptography-2.3-3.el8.x86_64 python3-jinja2-2.10.1-2.el8_0.noarch python3-jmespath-0.9.0-11.el8.noarch
python3-markupsafe-0.23-19.el8.x86_64 python3-paramiko-2.4.3-1.el8.noarch python3-pyasn1-0.3.7-6.el8.noarch
python3-pycparser-2.14-14.el8.noarch python3-pynacl-1.3.0-5.el8.x86_64 sshpass-1.06-9.el8.x86_64
Complete!
[root@Ansible yum.repos.d]# ansible --version
ansible 2.9.5
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, Aug 18 2020, 08:33:21) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
[root@Ansible yum.repos.d]#
本文链接:https://www.mingyuezhaowo.cn/index.php/archives/15/