LoginSignup
14
14

More than 5 years have passed since last update.

Ansible CentOS5で出るImportError: No module named simplejson の対処

Last updated at Posted at 2013-08-17

CentOS5 で チュートリアルを適当に進めようとすると多分、以下のエラーでハマる
https://github.com/ansible/ansible/issues/1529

ansible all -m ping

FAILED >> {
"failed": true,
"msg": "Traceback (most recent call last):\r\n\n File \"/home/adminn/.ansible/tmp/ansible-1352204366.62-260359853897483/ping\", line 63, in ?\r\n\n import simplejson as json\r\n\nImportError: No module named simplejson\r\n",
"parsed": false
}

ansibleの各種モジュールの実行にはpython-simplejsonが必要なようである。
ansibleを使うために各サーバーにpython-simplejsonを入れて手動で回る必要があるのかという
そんなことはない。
実はrawモジュールはsimplejsonが不要なようなので、それを使うとよい。

ansible  all  -i production -m raw -a "yum install -y python-simplejson"

最初にこれを実行すればあとは普通にほとんどのモジュールが利用出来る。

14
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
14