码迷,mamicode.com
首页 > 其他好文 > 详细

Ansible---关于yum奇葩问题记录

时间:2020-07-23 16:02:16      阅读:73      评论:0      收藏:0      [点我收藏+]

标签:register   manager   jpg   turn   cts   running   ade   pms   nsa   

注:ip全部用xxx.xxx.xxx.xxx代替

以下是我在ansible主机执行的结果,当我用yum模块的时候,报错如下

(venv) [root@hmys os_script]# ansible xxx.xxx.xxx.xxx -u root -m yum -a "state=installed name=readline-devel"
xxx.xxx.xxx.xxx | FAILED! => {
    "ansible_facts": {
        "pkg_mgr": "yum"
    },
    "changed": false,
    "msg": "http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#6 - \"Could not resolve host: mirrors.cloud.aliyuncs.com; Name or service not known\"\nTrying other mirror.\nhttp://mirrors.aliyun.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - \"Failed connect to mirrors.aliyun.com:80; Connection timed out\"\nTrying other mirror.\nhttp://mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - \"Failed connect to mirrors.aliyuncs.com:80; Connection timed out\"\nTrying other mirror.\nhttp://mirrors.aliyun.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - \"Failed connect to mirrors.aliyun.com:80; Connection timed out\"\nTrying other mirror.\nhttp://mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - \"Failed connect to mirrors.aliyuncs.com:80; Connection timed out\"\nTrying other mirror.\nhttp://mirrors.aliyun.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - \"Failed connect to mirrors.aliyun.com:80; Connection timed out\"\nTrying other mirror.\nhttp://mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - \"Failed connect to mirrors.aliyuncs.com:80; Connection timed out\"\nTrying other mirror.\nhttp://mirrors.aliyun.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - \"Failed connect to mirrors.aliyun.com:80; Connection timed out\"\nTrying other mirror.\nhttp://mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - \"Failed connect to mirrors.aliyuncs.com:80; Connection timed out\"\nTrying other mirror.\n\n\nError downloading packages:\n  readline-devel-6.2-11.el7.x86_64: [Errno 256] No more mirrors to try.\n\n",
    "rc": 1,
    "results": [
        "Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-\n              : manager\n\nThis system is not registered with an entitlement server. You can use subscription-manager to register.\n\nLoading mirror speeds from cached hostfile\n * base: mirrors.aliyun.com\n * epel: epel.mirror.angkasa.id\n * extras: mirrors.aliyun.com\n * updates: mirrors.aliyun.com\nResolving Dependencies\n--> Running transaction check\n---> Package readline-devel.x86_64 0:6.2-11.el7 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package                Arch           Version               Repository    Size\n================================================================================\nInstalling:\n readline-devel         x86_64         6.2-11.el7            base         139 k\n\nTransaction Summary\n================================================================================\nInstall  1 Package\n\nTotal download size: 139 k\nInstalled size: 259 k\nDownloading packages:\nDelta RPMs disabled because /usr/bin/applydeltarpm not installed.\n"
    ]
}

 

我尝试用shell模块执行,依然报错:

(venv) [root@hmys os_script]# ansible xxx.xxx.xxx.xxx -u root -m shell -a "yum install -y readline-devel"
 [WARNING]: Consider using the yum module rather than running yum.  If you need to use command because yum is insufficient you can add warn=False to this command task or set command_warnings=False in ansible.cfg to get rid of this message.

xxx.xxx.xxx.xxx | FAILED | rc=1 >>
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-
              : manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * epel: epel.mirror.angkasa.id
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package readline-devel.x86_64 0:6.2-11.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                Arch           Version               Repository    Size
================================================================================
Installing:
 readline-devel         x86_64         6.2-11.el7            base         139 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 139 k
Installed size: 259 k
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: mirrors.cloud.aliyuncs.com; Name or service not known"
Trying other mirror.
http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - "Failed connect to mirrors.aliyun.com:80; Connection timed out"
Trying other mirror.
http://mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection timed out"
Trying other mirror.
http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - "Failed connect to mirrors.aliyun.com:80; Connection timed out"
Trying other mirror.
http://mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection timed out"
Trying other mirror.
http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - "Failed connect to mirrors.aliyun.com:80; Connection timed out"
Trying other mirror.
http://mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection timed out"
Trying other mirror.
http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - "Failed connect to mirrors.aliyun.com:80; Connection timed out"
Trying other mirror.
http://mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection timed out"
Trying other mirror.


Error downloading packages:
  readline-devel-6.2-11.el7.x86_64: [Errno 256] No more mirrors to try.non-zero return code

然鹅,当我到远程主机去手动执行的时候,竟然执行成功了!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

[root@1a01vla6815zzzz test_permission]# yum install -y readline-devel
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * epel: epel.mirror.angkasa.id
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package readline-devel.x86_64 0:6.2-11.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================================================================================================================================
 Package                                                               Arch                                                          Version                                                             Repository                                                   Size
===========================================================================================================================================================================================================================================================================
Installing:
 readline-devel                                                        x86_64                                                        6.2-11.el7                                                          base                                                        139 k

Transaction Summary
===========================================================================================================================================================================================================================================================================
Install  1 Package

Total download size: 139 k
Installed size: 259 k
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
readline-devel-6.2-11.el7.x86_ FAILED                                          
http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/Packages/readline-devel-6.2-11.el7.x86_64.rpm: [Errno 14] HTTP Error 502 - Bad Gateway                                                                                              ]  0.0 B/s |    0 B  --:--:-- ETA 
Trying other mirror.
readline-devel-6.2-11.el7.x86_64.rpm                                                                                                                                                                                                                | 139 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : readline-devel-6.2-11.el7.x86_64                                                                                                                                                                                                                        1/1 
  Verifying  : readline-devel-6.2-11.el7.x86_64                                                                                                                                                                                                                        1/1 

Installed:
  readline-devel.x86_64 0:6.2-11.el7                                                                                                                                                                                                                                       

Complete!

技术图片

技术图片

 解决方案:整理中.......

Ansible---关于yum奇葩问题记录

标签:register   manager   jpg   turn   cts   running   ade   pms   nsa   

原文地址:https://www.cnblogs.com/cherylgi/p/13365561.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!