博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ansible问题汇总
阅读量:6289 次
发布时间:2019-06-22

本文共 2354 字,大约阅读时间需要 7 分钟。

1、yum模块安装RPM包时报错

报错信息:

\ndebug2: fd 3 setting TCP_NODELAY\r\ndebug2: callback done\r\ndebug2: channel 0: open confirm rwindow 0 rmax 32768\r\ndebug3: Wrote 752 bytes for a total of 2797\r\ndebug2: channel_input_status_confirm: type 99 id 0\r\ndebug2: PTY allocation request accepted on channel 0\r\ndebug2: channel 0: rcvd adjust 2097152\r\ndebug2: channel_input_status_confirm: type 99 id 0\r\ndebug2: exec request accepted on channel 0\r\ndebug1: client_input_channel_req: channel 0 rtype exit-status reply 0\r\ndebug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0\r\ndebug2: channel 0: rcvd eow\r\ndebug2: channel 0: close_read\r\ndebug2: channel 0: input open -> closed\r\ndebug2: channel 0: rcvd eof\r\ndebug2: channel 0: output open -> drain\r\ndebug2: channel 0: obuf empty\r\ndebug2: channel 0: close_write\r\ndebug2: channel 0: output drain -> closed\r\ndebug2: channel 0: rcvd close\r\ndebug3: channel 0: will not send data after close\r\ndebug2: channel 0: almost dead\r\ndebug2: channel 0: gc: notify user\r\ndebug2: channel 0: gc: user detached\r\ndebug2: channel 0: send close\r\ndebug2: channel 0: is dead\r\ndebug2: channel 0: garbage collecting\r\ndebug1: channel 0: free: client-session, nchannels 1\r\ndebug3: channel 0: status: The following connections are open:\r\n  #0 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)\r\n\r\ndebug3: channel 0: close_fds r -1 w -1 e 6\r\ndebug3: Wrote 32 bytes for a total of 2829\r\ndebug3: Wrote 64 bytes for a total of 2893\r\ndebug1: fd 1 clearing O_NONBLOCK\r\ndebug1: fd 2 clearing O_NONBLOCK\r\nConnection to 10.19.171.100 closed.\r\nTransferred: sent 2712, received 2296 bytes, in 0.1 seconds\r\nBytes per second: sent 35504.5, received 30058.3\r\ndebug1: Exit status 0\r\n", 

    "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_K19Zjg/ansible_module_yum.py\", line 25, in <module>\r\n    import yum\r\nImportError: No module named yum\r\n", 

    "msg": "MODULE FAILURE"

报错原因,远程主机上默认的python版本为python2.7,在playbook中加入以下配置

1
2
vars:
    
ansible_python_interpreter: 
/usr/bin/python2
.6

修改后的playbook如下:

1
2
3
4
5
6
7
8
- hosts: 
'{
{ HOST }}'
  
vars:
    
ansible_python_interpreter: 
/usr/bin/python2
.6
  
gather_facts: False
  
become: True
  
become_user: root
  
roles:
    
- { role: linux
/wf_install_jdk 
}
本文转自 曾哥最爱 51CTO博客,原文链接:http://blog.51cto.com/zengestudy/1975702,如需转载请自行联系原作者
你可能感兴趣的文章
bandit系列0--10
查看>>
文本过滤之grep,egreo及fgrep 三剑客及正则表达式
查看>>
实现Singleton模式在C#
查看>>
服务发现:Zookeeper vs etcd vs Consul
查看>>
微软企业项目管理系统技术研讨会
查看>>
Kafka设计篇之消息传输的事务定义
查看>>
我的友情链接
查看>>
使用windows 7 系统安装盘 DOS普通用户提权为管理员
查看>>
老男孩教育每日一题第115天:如何在centos 6下面实现命令补全?效果如下
查看>>
国内可用的yum源
查看>>
linux df -h 命令卡住 解决方法
查看>>
spring是什么,Spring能帮我们做什么
查看>>
Codeforces 861D - Polycarp's phone book
查看>>
FreePortScanner.java
查看>>
HttpURLConnection 文件上传限制
查看>>
javascript类式继承新的尝试
查看>>
真正掌握vuex的使用方法(四)
查看>>
MySql的Communications link failure解决办法
查看>>
GB2312编码
查看>>
架构探险笔记2
查看>>