{"action":"created","comment":{"url":"https://api.github.com/repos/travis-ci/packer-templates/pulls/comments/82413320","pull_request_review_id":3324900,"id":82413320,"diff_hunk":"@@ -0,0 +1,65 @@\n+#!/usr/bin/env bash\n+# vim:filetype=sh\n+\n+main() {\n+  : \"${GITHUB_USERS_ENV:=/etc/default/github-users}\"\n+  : \"${DEFAULT_GROUPS:=sudo}\"\n+\n+  if [[ -f \"${GITHUB_USERS_ENV}\" ]]; then\n+    # shellcheck source=/dev/null\n+    source \"${GITHUB_USERS_ENV}\"\n+  fi\n+\n+  DEFAULT_GROUPS=(${DEFAULT_GROUPS})\n+\n+  for pair in ${GITHUB_USERS}; do\n+    __create_user \"${pair%%:*}\" \"${DEFAULT_GROUPS[@]}\"\n+    __stub_zshrc \"${pair%%:*}\"\n+    __add_github_keys \"${pair%%:*}\" \"${pair##*:}\"\n+  done\n+}\n+\n+__create_user() {\n+  local username=\"${1}\"\n+  shift\n+  local groups=(\"${@}\")\n+\n+  if getent passwd \"${username}\"; then\n+    return\n+  fi\n+\n+  useradd \\\n+    -G \"${groups[@]}\" \\\n+    -U \\\n+    -d \"/home/${username}\" \\\n+    -m \\\n+    -s /bin/zsh \\\n+    \"${username}\"\n+}\n+\n+__stub_zshrc() {\n+  local username=\"${1}\"\n+  local zshrc=\"/home/${username}/.zshrc\"\n+\n+  if [[ -s \"${zshrc}\" ]]; then\n+    return\n+  fi\n+\n+  echo '# this space intentionally left blank' >\"${zshrc}\"","path":"cookbooks/travis_internal_base/files/default/create-users","position":48,"original_position":48,"commit_id":"604df981b0eee45272938db3cb30bf5fd04106c2","original_commit_id":"604df981b0eee45272938db3cb30bf5fd04106c2","user":{"login":"meatballhat","id":45143,"avatar_url":"https://avatars.githubusercontent.com/u/45143?v=3","gravatar_id":"","url":"https://api.github.com/users/meatballhat","html_url":"https://github.com/meatballhat","followers_url":"https://api.github.com/users/meatballhat/followers","following_url":"https://api.github.com/users/meatballhat/following{/other_user}","gists_url":"https://api.github.com/users/meatballhat/gists{/gist_id}","starred_url":"https://api.github.com/users/meatballhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meatballhat/subscriptions","organizations_url":"https://api.github.com/users/meatballhat/orgs","repos_url":"https://api.github.com/users/meatballhat/repos","events_url":"https://api.github.com/users/meatballhat/events{/privacy}","received_events_url":"https://api.github.com/users/meatballhat/received_events","type":"User","site_admin":false},"body":"This is me intentionally setting the user's `~/.zshrc` to a file with a comment in order to avoid the default zsh behavior of triggering a setup flow when `~/.zshrc` is missing.  It's the same behavior and comment that was previously being done by the `travis_users` cookbook, fwiw.","created_at":"2016-10-07T15:34:36Z","updated_at":"2016-10-07T15:34:36Z","html_url":"https://github.com/travis-ci/packer-templates/pull/307#discussion_r82413320","pull_request_url":"https://api.github.com/repos/travis-ci/packer-templates/pulls/307","_links":{"self":{"href":"https://api.github.com/repos/travis-ci/packer-templates/pulls/comments/82413320"},"html":{"href":"https://github.com/travis-ci/packer-templates/pull/307#discussion_r82413320"},"pull_request":{"href":"https://api.github.com/repos/travis-ci/packer-templates/pulls/307"}}},"pull_request":{"url":"https://api.github.com/repos/travis-ci/packer-templates/pulls/307","id":88456455,"html_url":"https://github.com/travis-ci/packer-templates/pull/307","diff_url":"https://github.com/travis-ci/packer-templates/pull/307.diff","patch_url":"https://github.com/travis-ci/packer-templates/pull/307.patch","issue_url":"https://api.github.com/repos/travis-ci/packer-templates/issues/307","number":307,"state":"open","locked":false,"title":"Clean up cloud-init configuration and default scripts","user":{"login":"meatballhat","id":45143,"avatar_url":"https://avatars.githubusercontent.com/u/45143?v=3","gravatar_id":"","url":"https://api.github.com/users/meatballhat","html_url":"https://github.com/meatballhat","followers_url":"https://api.github.com/users/meatballhat/followers","following_url":"https://api.github.com/users/meatballhat/following{/other_user}","gists_url":"https://api.github.com/users/meatballhat/gists{/gist_id}","starred_url":"https://api.github.com/users/meatballhat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meatballhat/subscriptions","organizations_url":"https://api.github.com/users/meatballhat/orgs","repos_url":"https://api.github.com/users/meatballhat/repos","events_url":"https://api.github.com/users/meatballhat/events{/privacy}","received_events_url":"https://api.github.com/users/meatballhat/received_events","type":"User","site_admin":false},"body":"based on recently-gained knowledge while working on terraform-config","created_at":"2016-10-07T15:13:48Z","updated_at":"2016-10-07T15:34:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2507cc2da9bc83ed1643a0f19118d749428233e0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/travis-ci/packer-templates/pulls/307/commits","review_comments_url":"https://api.github.com/repos/travis-ci/packer-templates/pulls/307/comments","review_comment_url":"https://api.github.com/repos/travis-ci/packer-templates/pulls/comments{/number}","comments_url":"https://api.github.com/repos/travis-ci/packer-templates/issues/307/comments","statuses_url":"https://api.github.com/repos/travis-ci/packer-templates/statuses/604df981b0eee45272938db3cb30bf5fd04106c2","head":{"label":"travis-ci:meat-cloud-init-cleanup","ref":"meat-cloud-init-cleanup","sha":"604df981b0eee45272938db3cb30bf5fd04106c2","user":{"login":"travis-ci","id":639823,"avatar_url":"https://avatars.githubusercontent.com/u/639823?v=3","gravatar_id":"","url":"https://api.github.com/users/travis-ci","html_url":"https://github.com/travis-ci","followers_url":"https://api.github.com/users/travis-ci/followers","following_url":"https://api.github.com/users/travis-ci/following{/other_user}","gists_url":"https://api.github.com/users/travis-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/travis-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travis-ci/subscriptions","organizations_url":"https://api.github.com/users/travis-ci/orgs","repos_url":"https://api.github.com/users/travis-ci/repos","events_url":"https://api.github.com/users/travis-ci/events{/privacy}","received_events_url":"https://api.github.com/users/travis-ci/received_events","type":"Organization","site_admin":false},"repo":{"id":36261810,"name":"packer-templates","full_name":"travis-ci/packer-templates","owner":{"login":"travis-ci","id":639823,"avatar_url":"https://avatars.githubusercontent.com/u/639823?v=3","gravatar_id":"","url":"https://api.github.com/users/travis-ci","html_url":"https://github.com/travis-ci","followers_url":"https://api.github.com/users/travis-ci/followers","following_url":"https://api.github.com/users/travis-ci/following{/other_user}","gists_url":"https://api.github.com/users/travis-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/travis-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travis-ci/subscriptions","organizations_url":"https://api.github.com/users/travis-ci/orgs","repos_url":"https://api.github.com/users/travis-ci/repos","events_url":"https://api.github.com/users/travis-ci/events{/privacy}","received_events_url":"https://api.github.com/users/travis-ci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/travis-ci/packer-templates","description":"Packer templates zOMG!","fork":false,"url":"https://api.github.com/repos/travis-ci/packer-templates","forks_url":"https://api.github.com/repos/travis-ci/packer-templates/forks","keys_url":"https://api.github.com/repos/travis-ci/packer-templates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/travis-ci/packer-templates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/travis-ci/packer-templates/teams","hooks_url":"https://api.github.com/repos/travis-ci/packer-templates/hooks","issue_events_url":"https://api.github.com/repos/travis-ci/packer-templates/issues/events{/number}","events_url":"https://api.github.com/repos/travis-ci/packer-templates/events","assignees_url":"https://api.github.com/repos/travis-ci/packer-templates/assignees{/user}","branches_url":"https://api.github.com/repos/travis-ci/packer-templates/branches{/branch}","tags_url":"https://api.github.com/repos/travis-ci/packer-templates/tags","blobs_url":"https://api.github.com/repos/travis-ci/packer-templates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/travis-ci/packer-templates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/travis-ci/packer-templates/git/refs{/sha}","trees_url":"https://api.github.com/repos/travis-ci/packer-templates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/travis-ci/packer-templates/statuses/{sha}","languages_url":"https://api.github.com/repos/travis-ci/packer-templates/languages","stargazers_url":"https://api.github.com/repos/travis-ci/packer-templates/stargazers","contributors_url":"https://api.github.com/repos/travis-ci/packer-templates/contributors","subscribers_url":"https://api.github.com/repos/travis-ci/packer-templates/subscribers","subscription_url":"https://api.github.com/repos/travis-ci/packer-templates/subscription","commits_url":"https://api.github.com/repos/travis-ci/packer-templates/commits{/sha}","git_commits_url":"https://api.github.com/repos/travis-ci/packer-templates/git/commits{/sha}","comments_url":"https://api.github.com/repos/travis-ci/packer-templates/comments{/number}","issue_comment_url":"https://api.github.com/repos/travis-ci/packer-templates/issues/comments{/number}","contents_url":"https://api.github.com/repos/travis-ci/packer-templates/contents/{+path}","compare_url":"https://api.github.com/repos/travis-ci/packer-templates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/travis-ci/packer-templates/merges","archive_url":"https://api.github.com/repos/travis-ci/packer-templates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/travis-ci/packer-templates/downloads","issues_url":"https://api.github.com/repos/travis-ci/packer-templates/issues{/number}","pulls_url":"https://api.github.com/repos/travis-ci/packer-templates/pulls{/number}","milestones_url":"https://api.github.com/repos/travis-ci/packer-templates/milestones{/number}","notifications_url":"https://api.github.com/repos/travis-ci/packer-templates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/travis-ci/packer-templates/labels{/name}","releases_url":"https://api.github.com/repos/travis-ci/packer-templates/releases{/id}","deployments_url":"https://api.github.com/repos/travis-ci/packer-templates/deployments","created_at":"2015-05-26T00:24:25Z","updated_at":"2016-10-04T16:48:57Z","pushed_at":"2016-10-07T15:13:48Z","git_url":"git://github.com/travis-ci/packer-templates.git","ssh_url":"git@github.com:travis-ci/packer-templates.git","clone_url":"https://github.com/travis-ci/packer-templates.git","svn_url":"https://github.com/travis-ci/packer-templates","homepage":null,"size":43166,"stargazers_count":31,"watchers_count":31,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":13,"forks":17,"open_issues":13,"watchers":31,"default_branch":"master"}},"base":{"label":"travis-ci:master","ref":"master","sha":"8a24cd02643ad2bd22a2779e16a23e9e342cc078","user":{"login":"travis-ci","id":639823,"avatar_url":"https://avatars.githubusercontent.com/u/639823?v=3","gravatar_id":"","url":"https://api.github.com/users/travis-ci","html_url":"https://github.com/travis-ci","followers_url":"https://api.github.com/users/travis-ci/followers","following_url":"https://api.github.com/users/travis-ci/following{/other_user}","gists_url":"https://api.github.com/users/travis-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/travis-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travis-ci/subscriptions","organizations_url":"https://api.github.com/users/travis-ci/orgs","repos_url":"https://api.github.com/users/travis-ci/repos","events_url":"https://api.github.com/users/travis-ci/events{/privacy}","received_events_url":"https://api.github.com/users/travis-ci/received_events","type":"Organization","site_admin":false},"repo":{"id":36261810,"name":"packer-templates","full_name":"travis-ci/packer-templates","owner":{"login":"travis-ci","id":639823,"avatar_url":"https://avatars.githubusercontent.com/u/639823?v=3","gravatar_id":"","url":"https://api.github.com/users/travis-ci","html_url":"https://github.com/travis-ci","followers_url":"https://api.github.com/users/travis-ci/followers","following_url":"https://api.github.com/users/travis-ci/following{/other_user}","gists_url":"https://api.github.com/users/travis-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/travis-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travis-ci/subscriptions","organizations_url":"https://api.github.com/users/travis-ci/orgs","repos_url":"https://api.github.com/users/travis-ci/repos","events_url":"https://api.github.com/users/travis-ci/events{/privacy}","received_events_url":"https://api.github.com/users/travis-ci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/travis-ci/packer-templates","description":"Packer templates zOMG!","fork":false,"url":"https://api.github.com/repos/travis-ci/packer-templates","forks_url":"https://api.github.com/repos/travis-ci/packer-templates/forks","keys_url":"https://api.github.com/repos/travis-ci/packer-templates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/travis-ci/packer-templates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/travis-ci/packer-templates/teams","hooks_url":"https://api.github.com/repos/travis-ci/packer-templates/hooks","issue_events_url":"https://api.github.com/repos/travis-ci/packer-templates/issues/events{/number}","events_url":"https://api.github.com/repos/travis-ci/packer-templates/events","assignees_url":"https://api.github.com/repos/travis-ci/packer-templates/assignees{/user}","branches_url":"https://api.github.com/repos/travis-ci/packer-templates/branches{/branch}","tags_url":"https://api.github.com/repos/travis-ci/packer-templates/tags","blobs_url":"https://api.github.com/repos/travis-ci/packer-templates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/travis-ci/packer-templates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/travis-ci/packer-templates/git/refs{/sha}","trees_url":"https://api.github.com/repos/travis-ci/packer-templates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/travis-ci/packer-templates/statuses/{sha}","languages_url":"https://api.github.com/repos/travis-ci/packer-templates/languages","stargazers_url":"https://api.github.com/repos/travis-ci/packer-templates/stargazers","contributors_url":"https://api.github.com/repos/travis-ci/packer-templates/contributors","subscribers_url":"https://api.github.com/repos/travis-ci/packer-templates/subscribers","subscription_url":"https://api.github.com/repos/travis-ci/packer-templates/subscription","commits_url":"https://api.github.com/repos/travis-ci/packer-templates/commits{/sha}","git_commits_url":"https://api.github.com/repos/travis-ci/packer-templates/git/commits{/sha}","comments_url":"https://api.github.com/repos/travis-ci/packer-templates/comments{/number}","issue_comment_url":"https://api.github.com/repos/travis-ci/packer-templates/issues/comments{/number}","contents_url":"https://api.github.com/repos/travis-ci/packer-templates/contents/{+path}","compare_url":"https://api.github.com/repos/travis-ci/packer-templates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/travis-ci/packer-templates/merges","archive_url":"https://api.github.com/repos/travis-ci/packer-templates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/travis-ci/packer-templates/downloads","issues_url":"https://api.github.com/repos/travis-ci/packer-templates/issues{/number}","pulls_url":"https://api.github.com/repos/travis-ci/packer-templates/pulls{/number}","milestones_url":"https://api.github.com/repos/travis-ci/packer-templates/milestones{/number}","notifications_url":"https://api.github.com/repos/travis-ci/packer-templates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/travis-ci/packer-templates/labels{/name}","releases_url":"https://api.github.com/repos/travis-ci/packer-templates/releases{/id}","deployments_url":"https://api.github.com/repos/travis-ci/packer-templates/deployments","created_at":"2015-05-26T00:24:25Z","updated_at":"2016-10-04T16:48:57Z","pushed_at":"2016-10-07T15:13:48Z","git_url":"git://github.com/travis-ci/packer-templates.git","ssh_url":"git@github.com:travis-ci/packer-templates.git","clone_url":"https://github.com/travis-ci/packer-templates.git","svn_url":"https://github.com/travis-ci/packer-templates","homepage":null,"size":43166,"stargazers_count":31,"watchers_count":31,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":13,"forks":17,"open_issues":13,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/travis-ci/packer-templates/pulls/307"},"html":{"href":"https://github.com/travis-ci/packer-templates/pull/307"},"issue":{"href":"https://api.github.com/repos/travis-ci/packer-templates/issues/307"},"comments":{"href":"https://api.github.com/repos/travis-ci/packer-templates/issues/307/comments"},"review_comments":{"href":"https://api.github.com/repos/travis-ci/packer-templates/pulls/307/comments"},"review_comment":{"href":"https://api.github.com/repos/travis-ci/packer-templates/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/travis-ci/packer-templates/pulls/307/commits"},"statuses":{"href":"https://api.github.com/repos/travis-ci/packer-templates/statuses/604df981b0eee45272938db3cb30bf5fd04106c2"}}}}
{"actor":{"display_login":"meatballhat"}}