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

Ansible问题汇总

时间:2017-10-24 22:41:22      阅读:285      评论:0      收藏:0      [点我收藏+]

标签:问题   ansible   

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中加入以下配置

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 }



本文出自 “zengestudy” 博客,请务必保留此出处http://zengestudy.blog.51cto.com/1702365/1975702

Ansible问题汇总

标签:问题   ansible   

原文地址:http://zengestudy.blog.51cto.com/1702365/1975702

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