Centos 7.9安装ansible

本文介绍了如何在CentOS系统中通过`yum`更新包并安装Epel仓库,列出与Ansible相关的软件包,然后使用`ansible`进行版本检查和安装。还详细展示了SSH密钥的生成与复制,以便于远程登录192.168.56.100。
摘要由CSDN通过智能技术生成
[root@ansible ~]# cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)
[root@ansible ~]# yum update -y
[root@ansible ~]# yum -y install epel-release
[root@ansible ~]# yum list | grep ansible
ansible.noarch                            2.9.25-1.el7                 epel     
ansible-collection-microsoft-sql.noarch   1.1.0-1.el7_9                extras   
ansible-doc.noarch                        2.9.25-1.el7                 epel     
ansible-inventory-grapher.noarch          2.4.4-1.el7                  epel     
ansible-lint.noarch                       3.5.1-1.el7                  epel     
ansible-openstack-modules.noarch          0-20140902git79d751a.el7     epel     
ansible-python3.noarch                    2.9.25-1.el7                 epel     
ansible-review.noarch                     0.13.4-1.el7                 epel     
ansible-test.noarch                       2.9.25-1.el7                 epel     
centos-release-ansible-27.noarch          1-1.el7                      extras   
centos-release-ansible-28.noarch          1-1.el7                      extras   
centos-release-ansible-29.noarch          1-1.el7                      extras   
centos-release-ansible26.noarch           1-3.el7.centos               extras   
kubernetes-ansible.noarch                 0.6.0-0.1.gitd65ebd5.el7     epel     
python2-ansible-runner.noarch             1.0.1-1.el7                  epel     
python2-ansible-tower-cli.noarch          3.3.9-1.el7                  epel     
vim-ansible.noarch                        3.2-1.el7                    epel 
[root@ansible ~]# yum install ansible -y
[root@ansible ~]# ansible --version
ansible 2.9.25
  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, Nov 16 2020, 22:23:17) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]


[root@ansible ansible]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:xq4BKQdAwMY2nHz5BN2n34f5F071IARdSoK/2u12sDM root@ansible
The key's randomart image is:
+---[RSA 2048]----+
|X...+ .  .oo...  |
| @ o o ... oo.   |
|o + o   o. ..    |
|   . o o  . . . .|
|  . +   S ..o. .o|
|   o . o ..+.. o.|
|      . .o .ooo .|
|       o. . E..o |
|      .    o.+.  |
+----[SHA256]-----+


[root@ansible ansible]# ssh-copy-id 192.168.56.100
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '192.168.56.100 (192.168.56.100)' can't be established.
ECDSA key fingerprint is SHA256:kbb/xaKinLr3YzSaqvkSuYr2x4MgX50QhnIPvZH6bcI.
ECDSA key fingerprint is MD5:67:a9:14:9d:8c:8b:35:8c:48:65:eb:ea:61:20:7b:92.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.56.100's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '192.168.56.100'"
and check to make sure that only the key(s) you wanted were added.
https://www.cndba.cn/hbhe0316/article/4994 https://www.cndba.cn/hbhe0316/article/4994
https://www.cndba.cn/hbhe0316/article/4994
https://www.cndba.cn/hbhe0316/article/4994
https://www.cndba.cn/hbhe0316/article/4994
https://www.cndba.cn/hbhe0316/article/4994
https://www.cndba.cn/hbhe0316/article/4994
https://www.cndba.cn/hbhe0316/article/4994
https://www.cndba.cn/hbhe0316/article/4994
https://www.cndba.cn/hbhe0316/article/4994

版权声明:本文为博主原创文章,未经博主允许不得转载。

ansible

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值