Question:
I’m using ansible to checkout my webapplication on EC2 web instances. My code is as followed:
1 2 3 4 5 6 7 8 9 10 11 12 |
- 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 |
As long as webapp_version = master
it works perfectly. But as soon as I put a SHA1 or Branch name it will fail.
1 2 3 4 5 |
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:
1 2 3 4 |
› ansible --version ansible 1.9.1 configured module search path = None |
Answer:
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 😉