我正在使用ansible在EC2 web实例上检出我的Web应用程序。 我的代码如下:
- name: Checkout the source code
git:
accept_hostkey=yes
depth=5
dest={{ webapp_dir }}
force=yes
key_file=/var/tmp/webapp_deploy_key
repo=git@github.com:MyRepo/web-app.git
update=yes
version={{ webapp_version }}
register: git_output
只要
webapp_version = master
,它就能完美运行。但是一旦我输入 SHA1 或分支名称,它就会失败。TASK: [webapp | Checkout the source code]
*************************************
failed: [52.17.69.83] => {"failed": true}
msg: Failed to checkout some-branch
我很奇怪。
我使用:
› ansible --version
ansible 1.9.1
configured module search path = None
depth
属性,然后在整个git目录上运行“rm -rf”命令,才能让它工作。 - winduptoy