我是靠谱客的博主 娇气毛衣,最近开发中收集的这篇文章主要介绍Ansible常见问题(已解决),觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

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

报错信息:

ndebug2: fd 3 setting TCP_NODELAYrndebug2: callback donerndebug2: channel 0: open confirm rwindow 0 rmax 32768rndebug3: Wrote 752 bytes for a total of 2797rndebug2: channel_input_status_confirm: type 99 id 0rndebug2: PTY allocation request accepted on channel 0rndebug2: channel 0: rcvd adjust 2097152rndebug2: channel_input_status_confirm: type 99 id 0rndebug2: exec request accepted on channel 0rndebug1: client_input_channel_req: channel 0 rtype exit-status reply 0rndebug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0rndebug2: channel 0: rcvd eowrndebug2: channel 0: close_readrndebug2: channel 0: input open -> closedrndebug2: channel 0: rcvd eofrndebug2: channel 0: output open -> drainrndebug2: channel 0: obuf emptyrndebug2: channel 0: close_writerndebug2: channel 0: output drain -> closedrndebug2: channel 0: rcvd closerndebug3: channel 0: will not send data after closerndebug2: channel 0: almost deadrndebug2: channel 0: gc: notify userrndebug2: channel 0: gc: user detachedrndebug2: channel 0: send closerndebug2: channel 0: is deadrndebug2: channel 0: garbage collectingrndebug1: channel 0: free: client-session, nchannels 1rndebug3: channel 0: status: The following connections are open:rn #0 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)rnrndebug3: channel 0: close_fds r -1 w -1 e 6rndebug3: Wrote 32 bytes for a total of 2829rndebug3: Wrote 64 bytes for a total of 2893rndebug1: fd 1 clearing O_NONBLOCKrndebug1: fd 2 clearing O_NONBLOCKrnConnection to 10.19.171.100 closed.rnTransferred: sent 2712, received 2296 bytes, in 0.1 secondsrnBytes per second: sent 35504.5, received 30058.3rndebug1: Exit status 0rn",

"module_stdout": "Traceback (most recent call last):rn  File "/tmp/ansible_K19Zjg/ansible_module_yum.py", line 25, in <module>rn    import yumrnImportError: No module named yumrn", 

"msg": "MODULE FAILURE"

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

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

修改后的playbook如下:

  • hosts: ‘{{ HOST }}’
    vars:
    ansible_python_interpreter: /usr/bin/python2.6
    gather_facts: False
    become: True
    become_user: root
    roles:
    • { role: linux/wf_install_jdk }

最后

以上就是娇气毛衣为你收集整理的Ansible常见问题(已解决)的全部内容,希望文章能够帮你解决Ansible常见问题(已解决)所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(62)

评论列表共有 0 条评论

立即
投稿
返回
顶部