首页 > 解决方案 > ansible zypper 安装卡在 SUSE 12 SP5 上

问题描述

我是 Reshma,我在为 zypper 模块运行 ansible 时遇到问题,因为它卡住了,没有给我失败/跳过/状态,也没有在目标主机上安装请求的包。如果有人可以帮助解决这个问题,那就太好了。

系统详情:

目标主机:SUSE 12 SP5

python-xml-2.7.17-28.51.1.x86_64  
rpm-4.11.2-16.21.1.x86_64  
zypper 1.13.51  

Ansible 命令:

ANSIBLE_DEBUG=1 ansible -i /etc/ansible/hosts webservers -k -m zypper -a 'name=git-core state=present' -v

调试输出:

3676 1600772716.28160: _low_level_execute_command(): executing: /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
3676 1600772716.37768: stdout chunk (state=2):

PLATFORM
<<<

3676 1600772716.37947: stdout chunk (state=3):

Linux
FOUND
/usr/bin/python
<<<

3676 1600772716.37989: stdout chunk (state=3):

/usr/bin/python3.6
/usr/bin/python2.7
/usr/bin/python3
/usr/bin/python
ENDFOUND
<<<

3676 1600772716.38378: stderr chunk (state=3):

<<<

3676 1600772716.38424: stdout chunk (state=3):

<<<

3676 1600772716.38484: _low_level_execute_command() done: rc=0, stdout=PLATFORM
Linux
FOUND
/usr/bin/python
/usr/bin/python3.6
/usr/bin/python2.7
/usr/bin/python3
/usr/bin/python
ENDFOUND
, stderr=
3676 1600772716.38530 [10.237.222.108]: found interpreters: [u'/usr/bin/python', u'/usr/bin/python3.6', u'/usr/bin/python2.7', u'/usr/bin/python3', u'/usr/bin/python']
3676 1600772716.38609: _low_level_execute_command(): starting
3676 1600772716.38650: _low_level_execute_command(): executing: /bin/sh -c '/usr/bin/python && sleep 0'
3676 1600772716.39569: Sending initial data
3676 1600772716.39658: Sent initial data (1234 bytes)
3676 1600772716.51494: stdout chunk (state=3):

{"osrelease_content": "NAME="SLES"\nVERSION="12-SP5"\nVERSION_ID="12.5"\nPRETTY_NAME="SUSE Linux Enterprise Server 12 SP5"\nID="sles"\nANSI_COLOR="0;32"\nCPE_NAME="cpe:/o:suse:sles:12:sp5"\n", "platform_dist_result": ["SuSE", "12", "x86_64"]}
<<<

3676 1600772716.51914: stderr chunk (state=3):

<<<

3676 1600772716.51960: stdout chunk (state=3):

<<<

3676 1600772716.52014: _low_level_execute_command() done: rc=0, stdout={"osrelease_content": "NAME="SLES"\nVERSION="12-SP5"\nVERSION_ID="12.5"\nPRETTY_NAME="SUSE Linux Enterprise Server 12 SP5"\nID="sles"\nANSI_COLOR="0;32"\nCPE_NAME="cpe:/o:suse:sles:12:sp5"\n", "platform_dist_result": ["SuSE", "12", "x86_64"]}
, stderr=
3676 1600772716.52196: ANSIBALLZ: using cached module: /root/.ansible/tmp/ansible-local-3668A5bmKd/ansiballz_cache/zypper-ZIP_DEFLATED
3676 1600772716.52622: transferring module to remote /root/.ansible/tmp/ansible-tmp-1600772715.9-203940692219450/AnsiballZ_zypper.py
3676 1600772716.53785: Sending initial data
3676 1600772716.53856: Sent initial data (138 bytes)
3676 1600772716.63011: stdout chunk (state=3):

sftp> put /root/.ansible/tmp/ansible-local-3668A5bmKd/tmpduCRmY /root/.ansible/tmp/ansible-tmp-1600772715.9-203940692219450/AnsiballZ_zypper.py
<<<

3676 1600772716.65358: stderr chunk (state=3):

<<<

3676 1600772716.65404: stdout chunk (state=3):

<<<

3676 1600772716.65466: done transferring module to remote
3676 1600772716.65532: _low_level_execute_command(): starting
3676 1600772716.65568: _low_level_execute_command(): executing: /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1600772715.9-203940692219450/ /root/.ansible/tmp/ansible-tmp-1600772715.9-203940692219450/AnsiballZ_zypper.py && sleep 0'
3676 1600772716.75915: stderr chunk (state=2):

<<<

3676 1600772716.76007: stdout chunk (state=2):

<<<

3676 1600772716.76066: _low_level_execute_command() done: rc=0, stdout=, stderr=
3676 1600772716.76099: _low_level_execute_command(): starting
3676 1600772716.76141: _low_level_execute_command(): executing: /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1600772715.9-203940692219450/AnsiballZ_zypper.py && sleep 0'

标签: ansible

解决方案


这是代理设置的问题,因此,在目标计算机上添加以下链接中提到的代理 https://www.suse.com/support/kb/doc/?id=000017441


推荐阅读