{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/42933","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/42933/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/42933/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/42933/events","html_url":"https://github.com/ansible/ansible/issues/42933","id":342265563,"node_id":"MDU6SXNzdWUzNDIyNjU1NjM=","number":42933,"title":"Can't update version of a role using ansible-galaxy without removing it myself","user":{"login":"Uwila","id":9699777,"node_id":"MDQ6VXNlcjk2OTk3Nzc=","avatar_url":"https://avatars3.githubusercontent.com/u/9699777?v=4","gravatar_id":"","url":"https://api.github.com/users/Uwila","html_url":"https://github.com/Uwila","followers_url":"https://api.github.com/users/Uwila/followers","following_url":"https://api.github.com/users/Uwila/following{/other_user}","gists_url":"https://api.github.com/users/Uwila/gists{/gist_id}","starred_url":"https://api.github.com/users/Uwila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Uwila/subscriptions","organizations_url":"https://api.github.com/users/Uwila/orgs","repos_url":"https://api.github.com/users/Uwila/repos","events_url":"https://api.github.com/users/Uwila/events{/privacy}","received_events_url":"https://api.github.com/users/Uwila/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-18T10:16:46Z","updated_at":"2018-07-18T10:19:19Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<!---\r\nVerify first that your issue/request is not already reported on GitHub.\r\nTHIS FORM WILL BE READ BY A MACHINE, COMPLETE ALL SECTIONS AS DESCRIBED.\r\nAlso test if the latest release, and devel branch are affected too.\r\nALWAYS add information AFTER (OUTSIDE) these html comments.\r\nOtherwise it may end up being automatically closed by our bot. -->\r\n\r\n##### SUMMARY\r\n<!--- Explain the problem briefly -->\r\nSay you write a role and put it in version control. You need it at some point so you install it. Later on you fix something in it, you update the version in your `requirements.yml` and `ansible-galaxy install -r requirements.yml` again. That doesn't work, it gives the error `/path/to/role doesn't appear to contain a role.` \r\n\r\n##### ISSUE TYPE\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\n<!--- Insert, BELOW THIS COMMENT, the name of the module, plugin, task or feature.\r\nDo not include extra details here, e.g. \"vyos_command\" not \"the network module vyos_command\" or the full path-->\r\n`ansible-galaxy`\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste, BELOW THIS COMMENT, verbatim output from \"ansible --version\" between quotes below -->\r\n```\r\nansible 2.7.0.dev0 (devel b6e9df2065) last updated 2018/07/17 14:58:07 (GMT +200)\r\n  config file = None\r\n  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /home/user/.venv/ansible/lib/ansible\r\n  executable location = /home/user/.venv/bin/ansible\r\n  python version = 3.6.5 (default, May 11 2018, 04:00:52) [GCC 8.1.0]\r\n```\r\n\r\n##### CONFIGURATION\r\n<!--- If using Ansible 2.4 or above, paste, BELOW THIS COMMENT, the results of \"ansible-config dump --only-changed\"\r\nOtherwise, mention any settings you have changed/added/removed in ansible.cfg\r\n(or using the ANSIBLE_* environment variables).-->\r\n```\r\nANSIBLE_NOCOWS(env: ANSIBLE_NOCOWS) = True\r\n```\r\n\r\n##### OS / ENVIRONMENT\r\n<!--- Mention, BELOW THIS COMMENT, 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\nAlso mention the specific version of what you are trying to control,\r\ne.g. if this is a network bug the version of firmware on the network device.-->\r\nN/A\r\n\r\n##### STEPS TO REPRODUCE\r\n<!--- For bugs, show exactly how to reproduce the problem, using a minimal test-case.\r\nFor new features, show how the feature would be used. -->\r\n\r\nWe start with the following directory structure, where `/home/user/ansible-test` is some arbitrary directory.\r\n\r\n```\r\n/home/user/ansible-test\r\n├── requirements.yml\r\n└── test-role\r\n    ├── meta\r\n    │   └── main.yml\r\n    └── tasks\r\n        └── main.yml\r\n```\r\n\r\n`requirements.yml`:\r\n```yaml\r\n---\r\n- name: test-role\r\n  version: f2be96\r\n  scm: git\r\n  src: /home/user/ansible-test/test-role\r\n```\r\n\r\nBoth `tasks/main.yml` and `meta/main.yml` are empty:\r\n\r\n```yaml\r\n---\r\n\r\n```\r\n\r\nNow I initialize a git repository in `test-role`, commit everything, and get some commit hash out of it. This is the commit hash that I used for the `version` in `requirements.yml`. Because of trailing newlines or whatever your exact hash may be different so make sure you use your own in `requirements.yml`.\r\n\r\nNow we run `ansible-galaxy install -r requirements.yml` and it runs fine.\r\n\r\nNow add some whitespace or something to one of the files in your `test-role` and commit it, so that we have a new version. Update the `requirements.yml` with this commit, and re-run `ansible-galaxy install -r requirements.yml --force` (the `--force` is because we replace an existing role).\r\n\r\n##### EXPECTED RESULTS\r\nThe role is updated to the new version\r\n\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->\r\n```\r\n- changing role test-role from f2be96 to e70226\r\n- extracting test-role to /home/user/.ansible/roles/test-role\r\n [WARNING]: - test-role was NOT installed successfully: /home/user/.ansible/roles/test-role doesn't appear to contain a role.   please remove this directory manually if you really want to put the role here.\r\n\r\nERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.\r\n```\r\n\r\nI can work around this by indeed removing the directory as the warning tells me, but it seems to me that it should just work without first having to remove it."},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/405883717","html_url":"https://github.com/ansible/ansible/issues/42933#issuecomment-405883717","issue_url":"https://api.github.com/repos/ansible/ansible/issues/42933","id":405883717,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTg4MzcxNw==","user":{"login":"ansibot","id":6585283,"node_id":"MDQ6VXNlcjY1ODUyODM=","avatar_url":"https://avatars0.githubusercontent.com/u/6585283?v=4","gravatar_id":"","url":"https://api.github.com/users/ansibot","html_url":"https://github.com/ansibot","followers_url":"https://api.github.com/users/ansibot/followers","following_url":"https://api.github.com/users/ansibot/following{/other_user}","gists_url":"https://api.github.com/users/ansibot/gists{/gist_id}","starred_url":"https://api.github.com/users/ansibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansibot/subscriptions","organizations_url":"https://api.github.com/users/ansibot/orgs","repos_url":"https://api.github.com/users/ansibot/repos","events_url":"https://api.github.com/users/ansibot/events{/privacy}","received_events_url":"https://api.github.com/users/ansibot/received_events","type":"User","site_admin":false},"created_at":"2018-07-18T10:19:19Z","updated_at":"2018-07-18T10:19:19Z","author_association":"CONTRIBUTOR","body":"Files identified in the description:\n* [lib/ansible/galaxy](https://github.com/ansible/ansible/blob/devel/lib/ansible/galaxy)\n\nIf these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.\n\n[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)\n<!--- boilerplate: components_banner --->"}}
{"actor":{"display_login":"ansibot"}}