2017-11-09 6 views
0

を変更すると任意のPythonライブラリを実行したり、ロードすることはできませんAnsibleは、デフォルトのpythonのパスansibleを変更した後ansible_python_interpreter

{ 
    "changed":false, 
    "failed":true, 
    "module_stderr":"Shared connection to x.x.x.x closed.\r\n", 
    "module_stdout":"Traceback (most recent call last):\r\n File \"/home/user/.ansible/tmp/ansible-tmp-1510222878.61-64380131096787/setup.py\", line 123, in <module>\r\n f.write(z.read('ansible_module_setup.py'))\r\n File \"/home/user/python/lib/p`enter code here`ython2.7/zipfile.py\", line 935, in read\r\n return self.open(name, \"r\", pwd).read()\r\n File \"/home/user/python/lib/python2.7/zipfile.py\", line 1010, in open\r\n close_fileobj=should_close)\r\n File \"/home/user/python/lib/python2.7/zipfile.py\", line 526, in __init__\r\n self._decompressor = zlib.decompressobj(-15)\r\nAttributeError: 'NoneType' object has no attribute 'decompressobj'\r\n", 
    "msg":"MODULE FAILURE", 
    "rc":0 
} 

後、私はまた、ansible -mピングを実行しようとした私は

ほとんど同じ結果を得る失敗します
{ 
    "changed":false, 
    "failed":true, 
    "module_stderr":"Shared connection to x.x.x.x closed.\r\n", 
    "module_stdout":"Traceback (most recent call last):\r\n File \"/home/user/.ansible/tmp/ansible-tmp-1510223942.9-58678212493208/ping.py\", line 123, in <module>\r\n f.write(z.read('ansible_module_ping.p 
y'))\r\n File \"/home/user/python/lib/python2.7/zipfile.py\", line 935, in read\r\n return self.open(name, \"r\", pwd).read()\r\n File \"/home/user/python/lib/python2.7/zipfile.py\", line 1010, in open\r\ 
n close_fileobj=should_close)\r\n File \"/home/user/python/lib/python2.7/zipfile.py\", line 526, in __init__\r\n self._decompressor = zlib.decompressobj(-15)\r\nAttributeError: 'NoneType' object has no a 
ttribute 'decompressobj'\r\n", 
    "msg":"MODULE FAILURE", 
    "rc":0 
} 

ansible 2.3.2.0

のpython 2.7.11

任意のヘルプは非常に高く評価されるだろう!

答えて

0

同じ問題が発生し、Ansible 2.1.6.0にダウングレードするだけで問題を解決できました。

このGitHub issueの人が同様の問題を報告し、Ansible/Ubuntuのバージョンを互換性がないためにそれをリンクされて:

最新ansibleを使用しているときI'vは、Ubuntuのサーバ16.04と14.04でこの問題を持っていた(2..3.1 .0)。 Ubuntuサーバー14.04のAnsibleバージョン2.2.2.0に戻った後、問題はなくなりました。だから、それは一般的にUbuntuの2.3.1.0の問題であるようです。