[ansible学习笔记]Error: ansible requires the stdlib json or simplejson module, neither was found!

一、执行ansible命令的时候客户端rhel56-192.168.209.133 出现如下错误:python

[root@reedoracle ansible]# ansible all -m command -a "python -V" -u reed
SSH password:
rhel56-192.168.209.133 | FAILED | rc=0 >>
Error: ansible requires the stdlib json or simplejson module, neither was found!

二、查看该客户端的python版本:json

[root@localhost ~]# python -V
Python 2.4.3

三、错误缘由:python版本太低bash

四、解决办法,二选一:oracle

1)升级客户端的python版本至python2.5.x及以上ssh

2)客户端上安装python-simplejsonide

附官方说明:ui

托管节点要求:ip

一般咱们使用 ssh 与托管节点通讯,默认使用 sftp.若是 sftp 不可用,可在 ansible.cfg 配置文件中配置成 scp 的方式. 在托管节点上也须要安装 Python 2.4 或以上的版本.若是版本低于 Python 2.5 ,还须要额外安装一个模块:it

  ● python-simplejsonclass

  ● 没安装python-simplejson,也可使用Ansible的”raw”模块和script模块,所以从技术上讲,你能够经过Ansible的”raw”模块安装python-simplejson,以后就可使用Ansible的全部功能了.

相关文章
相关标签/搜索