내가 내 Ansible 작전에 정의 된 자식 복제 작업이있어 :Ansible 배포 자식 클론 : "지역 변수 'remote_head은'전에 참조 할당"
이- 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'란 무엇입니까? 할당 전에 참조되는 이유는 무엇입니까?
여기에 무슨 일이 일어나는지 아는 사람이 있습니까?
https://github.com/ansible/ansible-modules-core/issues/5504 – techraf