{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/426","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/426/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/426/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/426/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/426","id":50634896,"number":426,"title":"git module doesn't clone the repo if update=no","user":{"login":"maethor","id":2410576,"avatar_url":"https://avatars.githubusercontent.com/u/2410576?v=3","gravatar_id":"","url":"https://api.github.com/users/maethor","html_url":"https://github.com/maethor","followers_url":"https://api.github.com/users/maethor/followers","following_url":"https://api.github.com/users/maethor/following{/other_user}","gists_url":"https://api.github.com/users/maethor/gists{/gist_id}","starred_url":"https://api.github.com/users/maethor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maethor/subscriptions","organizations_url":"https://api.github.com/users/maethor/orgs","repos_url":"https://api.github.com/users/maethor/repos","events_url":"https://api.github.com/users/maethor/events{/privacy}","received_events_url":"https://api.github.com/users/maethor/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bug_report","name":"bug_report","color":"fbca04"},{"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/P2","name":"P2","color":"fad8c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2014-12-02T10:33:18Z","updated_at":"2015-01-16T16:10:05Z","closed_at":"2014-12-17T21:46:06Z","body":"**Issue Type:**\r\n\r\nBug Report\r\n\r\n**Ansible Version:**\r\n\r\nansible 1.8.1\r\n\r\n**Environment:**\r\n\r\nDebian Wheezy\r\n\r\n**Summary:**\r\n\r\ngit module doesn't clone the repo if update=no\r\n\r\n**Steps To Reproduce:**\r\n\r\n`git: repo=ssh://git@github.com/xxx/yyyy.git dest=~/yyyy key_file=~/.ssh/github_key update=no`\r\n\r\n**Expected Results:**\r\n\r\nClone the repository in `~/yyyy`\r\n\r\n**Actual Results:**\r\n\r\n`~/yyyy` folder is created, but it is empty. "},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/70276429","html_url":"https://github.com/ansible/ansible-modules-core/issues/426#issuecomment-70276429","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/426","id":70276429,"user":{"login":"thiagol11","id":1494299,"avatar_url":"https://avatars.githubusercontent.com/u/1494299?v=3","gravatar_id":"","url":"https://api.github.com/users/thiagol11","html_url":"https://github.com/thiagol11","followers_url":"https://api.github.com/users/thiagol11/followers","following_url":"https://api.github.com/users/thiagol11/following{/other_user}","gists_url":"https://api.github.com/users/thiagol11/gists{/gist_id}","starred_url":"https://api.github.com/users/thiagol11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thiagol11/subscriptions","organizations_url":"https://api.github.com/users/thiagol11/orgs","repos_url":"https://api.github.com/users/thiagol11/repos","events_url":"https://api.github.com/users/thiagol11/events{/privacy}","received_events_url":"https://api.github.com/users/thiagol11/received_events","type":"User","site_admin":false},"created_at":"2015-01-16T16:10:05Z","updated_at":"2015-01-16T16:10:05Z","body":"I'm running ansible version 1.8.2 and just ran into this problem. For now, I solved it with this work around:\r\n~~~\r\n  - name: check if swift is already cloned\r\n    stat: path=/home/{{ username }}/swift\r\n    register: swift_cloned\r\n         \r\n  - name: git clone swift\r\n    git: repo=https://github.com/openstack/swift.git dest=/home/{{ username }}/swift \r\n    when: not swift_cloned.stat.exists\r\n~~~"}}