{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/ezbake/pulls/comments/239169693","pull_request_review_id":181888200,"id":239169693,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTE2OTY5Mw==","diff_hunk":"@@ -2,15 +2,24 @@\n # install.sh source based installation methodology.\n #\n # Add <%= EZBake::Config[:group] %> group\n-getent group <%= EZBake::Config[:group] %> > /dev/null || \\\n-  groupadd -r <%= EZBake::Config[:group] %> || :\n+<% if EZBake::Config[:numeric_uid_gid].nil? -%>\n+getent group <%= EZBake::Config[:group] %> >/dev/null || groupadd --system --force <%= EZBake::Config[:group] %>\n+<% else -%>\n+getent group <%= EZBake::Config[:group] %> >/dev/null || groupadd --system --force --gid <%= EZBake::Config[:numeric_uid_gid] %> <%= EZBake::Config[:group] %>\n+<% end -%>\n+\n # Add <%= EZBake::Config[:user] %> user\n if getent passwd <%= EZBake::Config[:user] %> > /dev/null; then\n   usermod --gid <%= EZBake::Config[:group] %> --home %{_app_data} \\\n   --comment \"<%= EZBake::Config[:project] %> daemon\" <%= EZBake::Config[:user] %> || :\n else\n-  useradd -r --gid <%= EZBake::Config[:group] %> --home %{_app_data} --shell $(which nologin) \\\n-    --comment \"<%= EZBake::Config[:project] %> daemon\"  <%= EZBake::Config[:user] %> || :\n+  useradd_options=('--system' '--gid' '<%= EZBake::Config[:group] %>' '--home' '%{_app_data}' '--shell' \"$(which nologin)\" '--comment' '<%= EZBake::Config[:project] %> daemon')\n+<% unless EZBake::Config[:numeric_uid_gid].nil? -%>\n+  if ! getent passwd <%= EZBake::Config[:numeric_uid_gid] %> > /dev/null; then\n+    useradd_options+=('--uid' '<%= EZBake::Config[:numeric_uid_gid] %>')\n+  fi\n+<% end -%>\n+  useradd \"${useradd_options[@]}\" <%= EZBake::Config[:user] %> || :","path":"resources/puppetlabs/lein-ezbake/template/global/ext/redhat/preinst.erb","position":25,"original_position":25,"commit_id":"0508a44d7183a6d487d049e2275718fe79cde387","original_commit_id":"0508a44d7183a6d487d049e2275718fe79cde387","user":{"login":"underscorgan","id":553464,"node_id":"MDQ6VXNlcjU1MzQ2NA==","avatar_url":"https://avatars1.githubusercontent.com/u/553464?v=4","gravatar_id":"","url":"https://api.github.com/users/underscorgan","html_url":"https://github.com/underscorgan","followers_url":"https://api.github.com/users/underscorgan/followers","following_url":"https://api.github.com/users/underscorgan/following{/other_user}","gists_url":"https://api.github.com/users/underscorgan/gists{/gist_id}","starred_url":"https://api.github.com/users/underscorgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/underscorgan/subscriptions","organizations_url":"https://api.github.com/users/underscorgan/orgs","repos_url":"https://api.github.com/users/underscorgan/repos","events_url":"https://api.github.com/users/underscorgan/events{/privacy}","received_events_url":"https://api.github.com/users/underscorgan/received_events","type":"User","site_admin":false},"body":"We're running groupadd with `--force`, so if we try to create it with a gid that already exists it will pick a different one ([manpage](https://linux.die.net/man/8/groupadd)). `useradd` doesn't support that functionality.","created_at":"2018-12-05T17:48:01Z","updated_at":"2018-12-05T17:48:01Z","html_url":"https://github.com/puppetlabs/ezbake/pull/512#discussion_r239169693","pull_request_url":"https://api.github.com/repos/puppetlabs/ezbake/pulls/512","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/ezbake/pulls/comments/239169693"},"html":{"href":"https://github.com/puppetlabs/ezbake/pull/512#discussion_r239169693"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/ezbake/pulls/512"}},"in_reply_to_id":238881433},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/ezbake/pulls/512","id":235602243,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1NjAyMjQz","html_url":"https://github.com/puppetlabs/ezbake/pull/512","diff_url":"https://github.com/puppetlabs/ezbake/pull/512.diff","patch_url":"https://github.com/puppetlabs/ezbake/pull/512.patch","issue_url":"https://api.github.com/repos/puppetlabs/ezbake/issues/512","number":512,"state":"open","locked":false,"title":"(EZ-128) Add support for specifying numeric uid/gid in rpm packages","user":{"login":"underscorgan","id":553464,"node_id":"MDQ6VXNlcjU1MzQ2NA==","avatar_url":"https://avatars1.githubusercontent.com/u/553464?v=4","gravatar_id":"","url":"https://api.github.com/users/underscorgan","html_url":"https://github.com/underscorgan","followers_url":"https://api.github.com/users/underscorgan/followers","following_url":"https://api.github.com/users/underscorgan/following{/other_user}","gists_url":"https://api.github.com/users/underscorgan/gists{/gist_id}","starred_url":"https://api.github.com/users/underscorgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/underscorgan/subscriptions","organizations_url":"https://api.github.com/users/underscorgan/orgs","repos_url":"https://api.github.com/users/underscorgan/repos","events_url":"https://api.github.com/users/underscorgan/events{/privacy}","received_events_url":"https://api.github.com/users/underscorgan/received_events","type":"User","site_admin":false},"body":"For RPM packaging, we have a reserved uid/gid for the 'puppet' user. To\r\nenable us to use the reserved uid/gid for the puppet user, ezbake needs\r\nto support an option for that. The new option is `numeric-uid-gid`,\r\nwhich can be set in the `:lein-ezbake` section of your project.clj.\r\n\r\nThis option is a noop for deb packaging. According to the debian policy\r\nguide\r\n(https://www.debian.org/doc/debian-policy/ch-opersys.html#uid-and-gid-classes)\r\nreserved uids and gids need to be set in the `base-passwd` package.","created_at":"2018-12-03T21:42:16Z","updated_at":"2018-12-05T17:48:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bedd2530f18b5f490ba43b232a515f03a8ab5891","assignee":null,"assignees":[],"requested_reviewers":[{"login":"sarameisburger","id":9062453,"node_id":"MDQ6VXNlcjkwNjI0NTM=","avatar_url":"https://avatars1.githubusercontent.com/u/9062453?v=4","gravatar_id":"","url":"https://api.github.com/users/sarameisburger","html_url":"https://github.com/sarameisburger","followers_url":"https://api.github.com/users/sarameisburger/followers","following_url":"https://api.github.com/users/sarameisburger/following{/other_user}","gists_url":"https://api.github.com/users/sarameisburger/gists{/gist_id}","starred_url":"https://api.github.com/users/sarameisburger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarameisburger/subscriptions","organizations_url":"https://api.github.com/users/sarameisburger/orgs","repos_url":"https://api.github.com/users/sarameisburger/repos","events_url":"https://api.github.com/users/sarameisburger/events{/privacy}","received_events_url":"https://api.github.com/users/sarameisburger/received_events","type":"User","site_admin":false},{"login":"e-gris","id":18489958,"node_id":"MDQ6VXNlcjE4NDg5OTU4","avatar_url":"https://avatars2.githubusercontent.com/u/18489958?v=4","gravatar_id":"","url":"https://api.github.com/users/e-gris","html_url":"https://github.com/e-gris","followers_url":"https://api.github.com/users/e-gris/followers","following_url":"https://api.github.com/users/e-gris/following{/other_user}","gists_url":"https://api.github.com/users/e-gris/gists{/gist_id}","starred_url":"https://api.github.com/users/e-gris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e-gris/subscriptions","organizations_url":"https://api.github.com/users/e-gris/orgs","repos_url":"https://api.github.com/users/e-gris/repos","events_url":"https://api.github.com/users/e-gris/events{/privacy}","received_events_url":"https://api.github.com/users/e-gris/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/ezbake/pulls/512/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/ezbake/pulls/512/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/ezbake/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/ezbake/issues/512/comments","statuses_url":"https://api.github.com/repos/puppetlabs/ezbake/statuses/0508a44d7183a6d487d049e2275718fe79cde387","head":{"label":"underscorgan:tickets/master/ez-128-numeric-uid-gid","ref":"tickets/master/ez-128-numeric-uid-gid","sha":"0508a44d7183a6d487d049e2275718fe79cde387","user":{"login":"underscorgan","id":553464,"node_id":"MDQ6VXNlcjU1MzQ2NA==","avatar_url":"https://avatars1.githubusercontent.com/u/553464?v=4","gravatar_id":"","url":"https://api.github.com/users/underscorgan","html_url":"https://github.com/underscorgan","followers_url":"https://api.github.com/users/underscorgan/followers","following_url":"https://api.github.com/users/underscorgan/following{/other_user}","gists_url":"https://api.github.com/users/underscorgan/gists{/gist_id}","starred_url":"https://api.github.com/users/underscorgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/underscorgan/subscriptions","organizations_url":"https://api.github.com/users/underscorgan/orgs","repos_url":"https://api.github.com/users/underscorgan/repos","events_url":"https://api.github.com/users/underscorgan/events{/privacy}","received_events_url":"https://api.github.com/users/underscorgan/received_events","type":"User","site_admin":false},"repo":{"id":45870974,"node_id":"MDEwOlJlcG9zaXRvcnk0NTg3MDk3NA==","name":"ezbake","full_name":"underscorgan/ezbake","private":false,"owner":{"login":"underscorgan","id":553464,"node_id":"MDQ6VXNlcjU1MzQ2NA==","avatar_url":"https://avatars1.githubusercontent.com/u/553464?v=4","gravatar_id":"","url":"https://api.github.com/users/underscorgan","html_url":"https://github.com/underscorgan","followers_url":"https://api.github.com/users/underscorgan/followers","following_url":"https://api.github.com/users/underscorgan/following{/other_user}","gists_url":"https://api.github.com/users/underscorgan/gists{/gist_id}","starred_url":"https://api.github.com/users/underscorgan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/underscorgan/subscriptions","organizations_url":"https://api.github.com/users/underscorgan/orgs","repos_url":"https://api.github.com/users/underscorgan/repos","events_url":"https://api.github.com/users/underscorgan/events{/privacy}","received_events_url":"https://api.github.com/users/underscorgan/received_events","type":"User","site_admin":false},"html_url":"https://github.com/underscorgan/ezbake","description":"A build system for trapperkeeper applications","fork":true,"url":"https://api.github.com/repos/underscorgan/ezbake","forks_url":"https://api.github.com/repos/underscorgan/ezbake/forks","keys_url":"https://api.github.com/repos/underscorgan/ezbake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/underscorgan/ezbake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/underscorgan/ezbake/teams","hooks_url":"https://api.github.com/repos/underscorgan/ezbake/hooks","issue_events_url":"https://api.github.com/repos/underscorgan/ezbake/issues/events{/number}","events_url":"https://api.github.com/repos/underscorgan/ezbake/events","assignees_url":"https://api.github.com/repos/underscorgan/ezbake/assignees{/user}","branches_url":"https://api.github.com/repos/underscorgan/ezbake/branches{/branch}","tags_url":"https://api.github.com/repos/underscorgan/ezbake/tags","blobs_url":"https://api.github.com/repos/underscorgan/ezbake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/underscorgan/ezbake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/underscorgan/ezbake/git/refs{/sha}","trees_url":"https://api.github.com/repos/underscorgan/ezbake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/underscorgan/ezbake/statuses/{sha}","languages_url":"https://api.github.com/repos/underscorgan/ezbake/languages","stargazers_url":"https://api.github.com/repos/underscorgan/ezbake/stargazers","contributors_url":"https://api.github.com/repos/underscorgan/ezbake/contributors","subscribers_url":"https://api.github.com/repos/underscorgan/ezbake/subscribers","subscription_url":"https://api.github.com/repos/underscorgan/ezbake/subscription","commits_url":"https://api.github.com/repos/underscorgan/ezbake/commits{/sha}","git_commits_url":"https://api.github.com/repos/underscorgan/ezbake/git/commits{/sha}","comments_url":"https://api.github.com/repos/underscorgan/ezbake/comments{/number}","issue_comment_url":"https://api.github.com/repos/underscorgan/ezbake/issues/comments{/number}","contents_url":"https://api.github.com/repos/underscorgan/ezbake/contents/{+path}","compare_url":"https://api.github.com/repos/underscorgan/ezbake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/underscorgan/ezbake/merges","archive_url":"https://api.github.com/repos/underscorgan/ezbake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/underscorgan/ezbake/downloads","issues_url":"https://api.github.com/repos/underscorgan/ezbake/issues{/number}","pulls_url":"https://api.github.com/repos/underscorgan/ezbake/pulls{/number}","milestones_url":"https://api.github.com/repos/underscorgan/ezbake/milestones{/number}","notifications_url":"https://api.github.com/repos/underscorgan/ezbake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/underscorgan/ezbake/labels{/name}","releases_url":"https://api.github.com/repos/underscorgan/ezbake/releases{/id}","deployments_url":"https://api.github.com/repos/underscorgan/ezbake/deployments","created_at":"2015-11-09T22:27:18Z","updated_at":"2018-12-03T21:30:58Z","pushed_at":"2018-12-04T23:34:22Z","git_url":"git://github.com/underscorgan/ezbake.git","ssh_url":"git@github.com:underscorgan/ezbake.git","clone_url":"https://github.com/underscorgan/ezbake.git","svn_url":"https://github.com/underscorgan/ezbake","homepage":null,"size":1485,"stargazers_count":0,"watchers_count":0,"language":"Clojure","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"a3984f78aa5a45cbafcddd548e543e3cfc6fef90","user":{"login":"puppetlabs","id":234268,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNDI2OA==","avatar_url":"https://avatars0.githubusercontent.com/u/234268?v=4","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":17420671,"node_id":"MDEwOlJlcG9zaXRvcnkxNzQyMDY3MQ==","name":"ezbake","full_name":"puppetlabs/ezbake","private":false,"owner":{"login":"puppetlabs","id":234268,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNDI2OA==","avatar_url":"https://avatars0.githubusercontent.com/u/234268?v=4","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/puppetlabs/ezbake","description":"A build system for trapperkeeper applications","fork":false,"url":"https://api.github.com/repos/puppetlabs/ezbake","forks_url":"https://api.github.com/repos/puppetlabs/ezbake/forks","keys_url":"https://api.github.com/repos/puppetlabs/ezbake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/ezbake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/ezbake/teams","hooks_url":"https://api.github.com/repos/puppetlabs/ezbake/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/ezbake/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/ezbake/events","assignees_url":"https://api.github.com/repos/puppetlabs/ezbake/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/ezbake/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/ezbake/tags","blobs_url":"https://api.github.com/repos/puppetlabs/ezbake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/ezbake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/ezbake/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/ezbake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/ezbake/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/ezbake/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/ezbake/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/ezbake/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/ezbake/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/ezbake/subscription","commits_url":"https://api.github.com/repos/puppetlabs/ezbake/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/ezbake/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/ezbake/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/ezbake/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/ezbake/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/ezbake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/ezbake/merges","archive_url":"https://api.github.com/repos/puppetlabs/ezbake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/ezbake/downloads","issues_url":"https://api.github.com/repos/puppetlabs/ezbake/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/ezbake/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/ezbake/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/ezbake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/ezbake/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/ezbake/releases{/id}","deployments_url":"https://api.github.com/repos/puppetlabs/ezbake/deployments","created_at":"2014-03-04T23:09:28Z","updated_at":"2018-11-29T21:04:15Z","pushed_at":"2018-12-04T23:34:23Z","git_url":"git://github.com/puppetlabs/ezbake.git","ssh_url":"git@github.com:puppetlabs/ezbake.git","clone_url":"https://github.com/puppetlabs/ezbake.git","svn_url":"https://github.com/puppetlabs/ezbake","homepage":null,"size":1460,"stargazers_count":3,"watchers_count":3,"language":"Clojure","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":23,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/ezbake/pulls/512"},"html":{"href":"https://github.com/puppetlabs/ezbake/pull/512"},"issue":{"href":"https://api.github.com/repos/puppetlabs/ezbake/issues/512"},"comments":{"href":"https://api.github.com/repos/puppetlabs/ezbake/issues/512/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/ezbake/pulls/512/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/ezbake/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/ezbake/pulls/512/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/ezbake/statuses/0508a44d7183a6d487d049e2275718fe79cde387"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"underscorgan"}}