2017-06-02 101 views
0

Im在Ubuntu 16.04上運行Ansible 2.0.0.2。我的劇本在1.9版本上運行良好,但在劇本運行結束時出現以下錯誤。ansible 2.0.0.2 - shutil.rmtree錯誤,但劇本成功

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錯誤。 我該如何解決

+1

好像你的Ansible軟件包有衝突或者安裝破壞:Ansible 2的'/ usr/bin/ansible -...'腳本,Ansible 1.9的python軟件包。 –

+0

謝謝。 我怎樣才能使蟒蛇版本相同? 我運行/ usr/bin/ansible --version並得到相同的錯誤。 – GergA

+1

不是「python版本」,而是「ansible python package version」。這取決於你是如何安裝它的。我建議刪除所有現有的Ansible安裝並通過'pip'安裝它。 –

回答

0

用下面的命令

sudo pip install ansible==2.1.1.0 

的易安裝的軟件包是2.1.1.0解決因此PIP版本應該增加相同的。

+1

您不應該同時使用apt和pip包!這個設置可能會造成各種奇怪的行爲。全部刪除並只安裝一個包。 –