ansible 2.0.0.2 - shutil.rmtree错误但剧本成功

时间:2017-06-02 07:08:03

标签: python jenkins ansible ubuntu-16.04

我在Ubuntu 16.04上运行Ansible 2.0.0.2。我的剧本在ansible 1.9上运行良好但我在剧本运行结束时遇到以下错误。

PLAY RECAP 
*********************************************************************
localhost                  : ok=62   changed=13   unreachable=0    failed=0   
clientnode.com             : ok=12   changed=3    unreachable=0    failed=0   

Traceback (most recent call last):
  File "/usr/bin/ansible-playbook", line 124, in <module>
    shutil.rmtree(C.DEFAULT_LOCAL_TMP, True)
AttributeError: 'module' object has no attribute 'DEFAULT_LOCAL_TMP'
Build step 'Execute shell' marked build as failure

因此,该剧本成功,但由于此python错误,Jenkins作业失败。 我该如何解决

1 个答案:

答案 0 :(得分:0)

使用以下命令解决

sudo pip install ansible==2.1.1.0 

apt安装包是2.1.1.0,因此pip版本应该增加到相同。