[ansible學習筆記]Error: ansible requires the stdlib json or simplejson module, neither was found!

來源:互聯網
上載者:User

標籤:python-simplejson

1、執行ansible命令的時候用戶端rhel56-192.168.209.133 出現以下錯誤:

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

2、查看該用戶端的python版本:

[[email protected] ~]# python -VPython 2.4.3

3、錯誤原因:python版本過低

4、解決辦法,二選一:

1)升級用戶端的python版本至python2.5.x及以上

2)用戶端上安裝python-simplejson

附官方說明:

託管節點要求:

通常我們使用 ssh 與託管節點通訊,預設使用 sftp.如果 sftp 不可用,可在 ansible.cfg 設定檔中配置成 scp 的方式. 在託管節點上也需要安裝 Python 2.4 或以上的版本.如果版本低於 Python 2.5 ,還需要額外安裝一個模組:

  ● python-simplejson

  ● 沒安裝python-simplejson,也可以使用Ansible的”raw”模組和script模組,因此從技術上講,你可以通過Ansible的”raw”模組安裝python-simplejson,之後就可以使用Ansible的所有功能了.


[ansible學習筆記]Error: ansible requires the stdlib json or simplejson module, neither was found!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.