I'm using ansible to checkout my webapplication on EC2 web instances. My code is as followed:
- name: Checkout the source code
git:
accept_hostkey=yes
depth=5
dest={{ webapp_dir }}
force=yes
key_file=/var/tmp/webapp_deploy_key
[email protected]:MyRepo/web-app.git
update=yes
version={{ webapp_version }}
register: git_output
As long as webapp_version = master
it works perfectly. But as soon as I put a SHA1 or Branch name it will fail.
TASK: [webapp | Checkout the source code]
*************************************
failed: [52.17.69.83] => {"failed": true}
msg: Failed to checkout some-branch
It's quite strange.
I use:
› ansible --version
ansible 1.9.1
configured module search path = None
And again I will answer one of my own questions. The
depth=5
was the killer. Well don't use it if you want to have access to all your different versions ;)