기본 Python 경로를 변경한 후 ansible에서 Python 라이브러리를 실행하거나 로드할 수 없습니다.
{
"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 ping을 실행해 보았습니다. 거의 같은 결과를 얻었습니다.
{
"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
}
안세보 2.3.2.0
파이썬 2.7.11
어떤 도움이라도 대단히 감사하겠습니다!