2017-01-10 22 views
2

「代入する前に、参照ローカル変数 『remote_head』」私は私のAnsible脚本で定義されているgitのクローンタスクを持っている:Ansible展開gitのクローン:

- name: Clone website git repository 
    git: > 
    dest=/var/www/mywebsite 
    [email protected]:MyOrganisation/MyWebsite.git 
    update=yes 
    force=yes 
    accept_hostkey=yes 
    version="{{ git_branch }}" 
    become: yes 
    become_user: www-data 
    register: cloned 

は、これは私がこれを配備する最初の時間を完全に正常に動作しますマシンが、私は(最新のバージョンにコードを更新するために)二時間、それを実行したときに、私は次のエラーを取得する:

TASK [Clone git repository]


fatal: [188.xxx.xx.xxx]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Shared connection to 188.xxx.xx.xxx closed.\r\n", "module_stdout": "\r\nTraceback (most recent call last):\r\n File "/tmp/ansible_7diacW/ansible_module_git.py", line 1040, in \r\n main()\r\n File "/tmp/ansible_7diacW/ansible_module_git.py", line 994, in main\r\n result.update(changed=True, after=remote_head, msg='Local modifications exist')\r\nUnboundLocalError: local variable 'remote_head' referenced before assignment\r\n", "msg": "MODULE FAILURE"} to retry, use: --limit @/Users/kramer65/repos/mywebsite/ansible/php.retry

私は問題がここにあるものをわかりませんよ。ローカル変数 'remote_head'とは何ですか?なぜそれが割り当ての前に参照されているのですか?

誰でもここで何が起こっているのか分かりませんか?

+1

https://github.com/ansible/ansible-modules-core/issues/5504 – techraf

答えて

0

私はそれが「はdevelのにマージし、安定した-2.2にバックポート。」。だthey sayするa Pull Request got mergedを見つけ@techrafことにより、コメントに与えthe issue link

2.2.0.0から2.2.0.0_2への私のバージョンをアップグレードしたばかりで、もう一度私のために機能します。

[EDIT]

私の小さな整流@techraf

感謝。 * より良いと思われる今。それは私がそれがしばしばうまくいくことを意味しますが、時々そうではありませんそれがうまくいかなければ、それをやり直すことはしばしば私にとって仕事をするようです。他の誰かがより良いアイデアを持っているなら、私はそれらを聞いてうれしいです。

関連する問題