{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/galaxy/issues/17","repository_url":"https://api.github.com/repos/ansible/galaxy","labels_url":"https://api.github.com/repos/ansible/galaxy/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/ansible/galaxy/issues/17/comments","events_url":"https://api.github.com/repos/ansible/galaxy/issues/17/events","html_url":"https://github.com/ansible/galaxy/pull/17","id":183270053,"number":17,"title":"Selinux fix so containers get build on CentOS/RHEL","user":{"login":"rabem00","id":15912963,"avatar_url":"https://avatars.githubusercontent.com/u/15912963?v=3","gravatar_id":"","url":"https://api.github.com/users/rabem00","html_url":"https://github.com/rabem00","followers_url":"https://api.github.com/users/rabem00/followers","following_url":"https://api.github.com/users/rabem00/following{/other_user}","gists_url":"https://api.github.com/users/rabem00/gists{/gist_id}","starred_url":"https://api.github.com/users/rabem00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rabem00/subscriptions","organizations_url":"https://api.github.com/users/rabem00/orgs","repos_url":"https://api.github.com/users/rabem00/repos","events_url":"https://api.github.com/users/rabem00/events{/privacy}","received_events_url":"https://api.github.com/users/rabem00/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-10-16T14:31:28Z","updated_at":"2016-10-18T09:34:59Z","closed_at":"2016-10-18T09:34:59Z","pull_request":{"url":"https://api.github.com/repos/ansible/galaxy/pulls/17","html_url":"https://github.com/ansible/galaxy/pull/17","diff_url":"https://github.com/ansible/galaxy/pull/17.diff","patch_url":"https://github.com/ansible/galaxy/pull/17.patch"},"body":"When running a make build (or make refresh) the docker volume ${PWD}:/galaxy was not accessible because of a selinux issue on cents 7.x or rhel 7.x. Result the build fails with the following issue:\r\n\r\n[Errno 13] Permission denied: '/galaxy/requirements.txt\r\n\r\nA complete output of the issue:\r\n```\r\nansible-container_1  | TASK [Clear yum cache] *********************************************************\r\nansible-container_1  | changed: [django]\r\nansible-container_1  |  [WARNING]: Consider using yum module rather than running yum\r\nansible-container_1  | \r\nansible-container_1  | TASK [Install python packages] *************************************************\r\nansible-container_1  | fatal: [django]: FAILED! => {\"changed\": false, \"cmd\": \"/usr/bin/pip install -r /galaxy/requirements.txt\", \"failed\": true, \"msg\": \"\\n:stderr: You are using pip version 7.1.0, however version 8.1.2 is available.\\nYou should consider upgrading via the 'pip install --upgrade pip' command.\\nCould not open requirements file: [Errno 13] Permission denied: '/galaxy/requirements.txt'\\n\"}\r\nansible-container_1  |  [WARNING]: Could not create retry file 'main.retry'.         [Errno 2] No such\r\nansible-container_1  | file or directory: ''\r\nansible-container_1  | \r\n```\r\n\r\nThe docker inspect command shows:  /galaxy:rw , connecting with _make shell_ and trying to access the /galaxy directory will result in a permission denied. This could be fixed by adding option behind the /galaxy volume. This works but the next selinux problem occurs:\r\n\r\n```\r\nansible-container_1  | TASK [Create the /etc/galaxy directory] ****************************************\r\nansible-container_1  | fatal: [django]: FAILED! => {\"changed\": false, \"failed\": true, \"gid\": 0, \"group\": \"root\", \"mode\": \"0755\", \"msg\": \"chgrp failed\", \"owner\": \"root\", \"path\": \"/etc/galaxy\", \"size\": 6, \"state\": \"directory\", \"uid\": 0}\r\nansible-container_1  |  [WARNING]: Could not create retry file 'main.retry'.         [Errno 2] No such\r\nansible-container_1  | file or directory: ''\r\n```\r\n\r\nSo we need another fix then the z option described in [see volumes selinux for more info](http://www.projectatomic.io/blog/2015/06/using-volumes-with-docker-can-cause-problems-with-selinux/)\r\n\r\n**By adding more privileges in the container.yml file everything gets build without problems. So adding privileged: yes appears to be the solution.**\r\n\r\nMy system is up to date and running:\r\nCentOS Linux release 7.2.1511 (Core) \r\nNo packages marked for update"},"comment":{"url":"https://api.github.com/repos/ansible/galaxy/issues/comments/254456726","html_url":"https://github.com/ansible/galaxy/pull/17#issuecomment-254456726","issue_url":"https://api.github.com/repos/ansible/galaxy/issues/17","id":254456726,"user":{"login":"rabem00","id":15912963,"avatar_url":"https://avatars.githubusercontent.com/u/15912963?v=3","gravatar_id":"","url":"https://api.github.com/users/rabem00","html_url":"https://github.com/rabem00","followers_url":"https://api.github.com/users/rabem00/followers","following_url":"https://api.github.com/users/rabem00/following{/other_user}","gists_url":"https://api.github.com/users/rabem00/gists{/gist_id}","starred_url":"https://api.github.com/users/rabem00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rabem00/subscriptions","organizations_url":"https://api.github.com/users/rabem00/orgs","repos_url":"https://api.github.com/users/rabem00/repos","events_url":"https://api.github.com/users/rabem00/events{/privacy}","received_events_url":"https://api.github.com/users/rabem00/received_events","type":"User","site_admin":false},"created_at":"2016-10-18T09:34:59Z","updated_at":"2016-10-18T09:34:59Z","body":"Will close the pull request and post a bug"}}
{"actor":{"display_login":"rabem00"}}