{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5457","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5457/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5457/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5457/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/5457","id":186761222,"number":5457,"title":"Git module fail to checkout by tag","user":{"login":"gsempe","id":1011479,"avatar_url":"https://avatars.githubusercontent.com/u/1011479?v=3","gravatar_id":"","url":"https://api.github.com/users/gsempe","html_url":"https://github.com/gsempe","followers_url":"https://api.github.com/users/gsempe/followers","following_url":"https://api.github.com/users/gsempe/following{/other_user}","gists_url":"https://api.github.com/users/gsempe/gists{/gist_id}","starred_url":"https://api.github.com/users/gsempe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsempe/subscriptions","organizations_url":"https://api.github.com/users/gsempe/orgs","repos_url":"https://api.github.com/users/gsempe/repos","events_url":"https://api.github.com/users/gsempe/events{/privacy}","received_events_url":"https://api.github.com/users/gsempe/received_events","type":"User","site_admin":false},"labels":[{"id":437720380,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/affects_2.2","name":"affects_2.2","color":"5319e7","default":false},{"id":132571937,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bug_report","name":"bug_report","color":"fbca04","default":false},{"id":414073372,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/waiting_on_maintainer","name":"waiting_on_maintainer","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-02T10:18:07Z","updated_at":"2016-11-04T17:10:05Z","closed_at":null,"body":"<!--- Verify first that your issue/request is not already reported in GitHub -->\r\n\r\n##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\n<!--- Name of the plugin/module/task -->\r\ngit\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible --version\r\nansible 2.2.0.0\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### CONFIGURATION\r\n<!---\r\nMention any settings you have changed/added/removed in ansible.cfg\r\n(or using the ANSIBLE_* environment variables).\r\n-->\r\n\r\n##### OS / ENVIRONMENT\r\n<!---\r\nMention the OS you are running Ansible from, and the OS you are\r\nmanaging, or say “N/A” for anything that is not platform-specific.\r\n-->\r\n```\r\n~ lsb_release -a\r\nNo LSB modules are available.\r\nDistributor ID:\tUbuntu\r\nDescription:\tUbuntu 14.04.5 LTS\r\nRelease:\t14.04\r\nCodename:\ttrusty\r\n```\r\n##### SUMMARY\r\n<!--- Explain the problem briefly -->\r\n\r\n##### STEPS TO REPRODUCE\r\n<!---\r\nFor bugs, show exactly how to reproduce the problem.\r\nFor new features, show how the feature would be used.\r\n-->\r\nCheckout a git version by tag, it fails the first time, works the second time\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```\r\n~ ansible all -i \"localhost,\" -c local -m git -a \"accept_hostkey=false bare=false force=false recursive=true remote=origin ssh_opts=\\\"-o StrictHostKeyChecking=no\\\" repo=git@github.com:XxxApp/xxxxapi.git track_submodules=false update=true verify_commit=false accept_hostkey=false clone=true depth=1 dest=repo version=v0.5.12\" -vvv\r\n```\r\n<!--- You can also paste gist.github.com links for larger files -->\r\n\r\n##### EXPECTED RESULTS\r\n<!--- What did you expect to happen when running the steps above? -->\r\nThe expected result is obtained by calling again the command right after the first try fail with the error\r\n```\r\n~ ansible all -i \"localhost,\" -c local -m git -a \"accept_hostkey=false bare=false force=false recursive=true remote=origin ssh_opts=\\\"-o StrictHostKeyChecking=no\\\" repo=git@github.com:XxxApp/xxxxapi.git track_submodules=false update=true verify_commit=false accept_hostkey=false clone=true depth=1 dest=repo version=v0.5.12\" -vvv\r\nUsing /etc/ansible/ansible.cfg as config file\r\nUsing module file /usr/lib/python2.7/dist-packages/ansible/modules/core/source_control/git.py\r\n<localhost> ESTABLISH LOCAL CONNECTION FOR USER: guillaume\r\n<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p \"` echo $HOME/.ansible/tmp/ansible-tmp-1478081391.46-45024913046372 `\" && echo ansible-tmp-1478081391.46-45024913046372=\"` echo $HOME/.ansible/tmp/ansible-tmp-1478081391.46-45024913046372 `\" ) && sleep 0'\r\n<localhost> PUT /tmp/tmpBfIVOX TO /home/guillaume/.ansible/tmp/ansible-tmp-1478081391.46-45024913046372/git.py\r\n<localhost> EXEC /bin/sh -c 'chmod u+x /home/guillaume/.ansible/tmp/ansible-tmp-1478081391.46-45024913046372/ /home/guillaume/.ansible/tmp/ansible-tmp-1478081391.46-45024913046372/git.py && sleep 0'\r\n<localhost> EXEC /bin/sh -c '/usr/bin/python /home/guillaume/.ansible/tmp/ansible-tmp-1478081391.46-45024913046372/git.py; rm -rf \"/home/guillaume/.ansible/tmp/ansible-tmp-1478081391.46-45024913046372/\" > /dev/null 2>&1 && sleep 0'\r\nlocalhost | SUCCESS => {\r\n    \"after\": \"b170e167101ac570276610ddff6d351d0663a759\",\r\n    \"before\": \"42956afcc8d20475cbbe773ee74c1b44ebc41d9f\",\r\n    \"changed\": true,\r\n    \"invocation\": {\r\n        \"module_args\": {\r\n            \"accept_hostkey\": false,\r\n            \"bare\": false,\r\n            \"clone\": true,\r\n            \"depth\": 1,\r\n            \"dest\": \"repo\",\r\n            \"executable\": null,\r\n            \"force\": false,\r\n            \"key_file\": null,\r\n            \"recursive\": true,\r\n            \"reference\": null,\r\n            \"refspec\": null,\r\n            \"remote\": \"origin\",\r\n            \"repo\": \"git@github.com:XxxApp/xxxxapi.git\",\r\n            \"ssh_opts\": \"-o StrictHostKeyChecking=no\",\r\n            \"track_submodules\": false,\r\n            \"umask\": null,\r\n            \"update\": true,\r\n            \"verify_commit\": false,\r\n            \"version\": \"v0.5.12\"\r\n        },\r\n        \"module_name\": \"git\"\r\n    },\r\n    \"warnings\": []\r\n}\r\n```\r\n\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->\r\nThe git checkout fail with the message `error: pathspec 'v0.5.12' did not match any file(s) known to git.`\r\nBy the way it works when the call is done again right away after the error\r\n<!--- Paste verbatim command output between quotes below -->\r\n```\r\nUsing /etc/ansible/ansible.cfg as config file\r\nUsing module file /usr/lib/python2.7/dist-packages/ansible/modules/core/source_control/git.py\r\n<localhost> ESTABLISH LOCAL CONNECTION FOR USER: guillaume\r\n<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p \"` echo $HOME/.ansible/tmp/ansible-tmp-1478081241.08-36524975238824 `\" && echo ansible-tmp-1478081241.08-36524975238824=\"` echo $HOME/.ansible/tmp/ansible-tmp-1478081241.08-36524975238824 `\" ) && sleep 0'\r\n<localhost> PUT /tmp/tmpbWAroh TO /home/guillaume/.ansible/tmp/ansible-tmp-1478081241.08-36524975238824/git.py\r\n<localhost> EXEC /bin/sh -c 'chmod u+x /home/guillaume/.ansible/tmp/ansible-tmp-1478081241.08-36524975238824/ /home/guillaume/.ansible/tmp/ansible-tmp-1478081241.08-36524975238824/git.py && sleep 0'\r\n<localhost> EXEC /bin/sh -c '/usr/bin/python /home/guillaume/.ansible/tmp/ansible-tmp-1478081241.08-36524975238824/git.py; rm -rf \"/home/guillaume/.ansible/tmp/ansible-tmp-1478081241.08-36524975238824/\" > /dev/null 2>&1 && sleep 0'\r\nlocalhost | FAILED! => {\r\n    \"changed\": false,\r\n    \"cmd\": \"/usr/bin/git checkout --force v0.5.12\",\r\n    \"failed\": true,\r\n    \"invocation\": {\r\n        \"module_args\": {\r\n            \"accept_hostkey\": false,\r\n            \"bare\": false,\r\n            \"clone\": true,\r\n            \"depth\": 1,\r\n            \"dest\": \"repo\",\r\n            \"executable\": null,\r\n            \"force\": false,\r\n            \"key_file\": null,\r\n            \"recursive\": true,\r\n            \"reference\": null,\r\n            \"refspec\": null,\r\n            \"remote\": \"origin\",\r\n            \"repo\": \"git@github.com:XxxApp/xxxxapi.git\",\r\n            \"ssh_opts\": \"-o StrictHostKeyChecking=no\",\r\n            \"track_submodules\": false,\r\n            \"umask\": null,\r\n            \"update\": true,\r\n            \"verify_commit\": false,\r\n            \"version\": \"v0.5.12\"\r\n        },\r\n        \"module_name\": \"git\"\r\n    },\r\n    \"msg\": \"Failed to checkout v0.5.12\",\r\n    \"rc\": 1,\r\n    \"stderr\": \"error: pathspec 'v0.5.12' did not match any file(s) known to git.\\n\",\r\n    \"stdout\": \"\",\r\n    \"stdout_lines\": []\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/258491106","html_url":"https://github.com/ansible/ansible-modules-core/issues/5457#issuecomment-258491106","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5457","id":258491106,"user":{"login":"gsempe","id":1011479,"avatar_url":"https://avatars.githubusercontent.com/u/1011479?v=3","gravatar_id":"","url":"https://api.github.com/users/gsempe","html_url":"https://github.com/gsempe","followers_url":"https://api.github.com/users/gsempe/followers","following_url":"https://api.github.com/users/gsempe/following{/other_user}","gists_url":"https://api.github.com/users/gsempe/gists{/gist_id}","starred_url":"https://api.github.com/users/gsempe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsempe/subscriptions","organizations_url":"https://api.github.com/users/gsempe/orgs","repos_url":"https://api.github.com/users/gsempe/repos","events_url":"https://api.github.com/users/gsempe/events{/privacy}","received_events_url":"https://api.github.com/users/gsempe/received_events","type":"User","site_admin":false},"created_at":"2016-11-04T17:10:05Z","updated_at":"2016-11-04T17:10:05Z","body":"As an additional information it works with version 2.1.0.0 and so, as a workaround, we moved back to this version"}}
{"actor":{"display_login":"gsempe"}}