{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/pulls/comments/199261929","pull_request_review_id":133354402,"id":199261929,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTI2MTkyOQ==","diff_hunk":"@@ -0,0 +1,50 @@\n+#!/usr/bin/env bash\n+\n+# Install PE:\n+# First, copy the PE installer tarball and pe_conf file to the node\n+# Then, execute the task as per the following example:\n+# bolt task --modulepath modules run 'ref_arch_setup::install_pe installer_path=puppet-enterprise-2018.1.1-el-7-x86_64.tar.gz pe_conf_path=pe.conf' --nodes bdjshmr8bx75q2a.delivery.puppetlabs.net\n+\n+\n+execute_command() {\n+    cmd=$1\n+    echo \"Executing: $cmd\"\n+    eval $cmd\n+    cmd_exit_code=$?\n+\n+    # if number of args is 1, check for exit code = 0, otherwise check for exit code = value of second arg\n+    if [ $# -eq 1 ]\n+    then\n+        expected_exit_code=0\n+    else\n+        expected_exit_code=$2\n+    fi\n+    if [ $cmd_exit_code -ne $expected_exit_code ]\n+    then\n+        echo \"Command '$1' failed - expected_exit_code: $expected_exit_code, actual_exit_code: $cmd_exit_code\"\n+        exit 1\n+    fi\n+}\n+\n+# Install tar using existing package manager if it is not already installed\n+if [ \"\" == \"`which tar`\" ]\n+then\n+    echo \"Tar Not Found\"\n+    if [ -n \"`which apt-get`\" ]\n+    then\n+        execute_command \"apt-get -y install tar\"\n+    elif [ -n \"`which yum`\" ]\n+    then\n+        execute_command \"yum -y install tar\"\n+    else\n+        echo \"OS does not have apt-get or yum package manager\"\n+        exit 1\n+    fi\n+fi\n+\n+execute_command \"tar -xvf $PT_installer_path\"\n+# Using -* so we don't have to know the specific version, or parse it from the install path\n+execute_command \"sh ./puppet-enterprise-*/puppet-enterprise-installer -c $PT_pe_conf_path\"\n+execute_command \"puppet agent -t\" 2\n+execute_command \"puppet agent -t\" 2\n+exit 0","path":"modules/ref_arch_setup/tasks/install_pe.sh","position":50,"original_position":50,"commit_id":"d51723ae56cee8cf6971075efea951c89a63d53f","original_commit_id":"d51723ae56cee8cf6971075efea951c89a63d53f","user":{"login":"samwoods1","id":4604901,"node_id":"MDQ6VXNlcjQ2MDQ5MDE=","avatar_url":"https://avatars3.githubusercontent.com/u/4604901?v=4","gravatar_id":"","url":"https://api.github.com/users/samwoods1","html_url":"https://github.com/samwoods1","followers_url":"https://api.github.com/users/samwoods1/followers","following_url":"https://api.github.com/users/samwoods1/following{/other_user}","gists_url":"https://api.github.com/users/samwoods1/gists{/gist_id}","starred_url":"https://api.github.com/users/samwoods1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samwoods1/subscriptions","organizations_url":"https://api.github.com/users/samwoods1/orgs","repos_url":"https://api.github.com/users/samwoods1/repos","events_url":"https://api.github.com/users/samwoods1/events{/privacy}","received_events_url":"https://api.github.com/users/samwoods1/received_events","type":"User","site_admin":false},"body":"We definitely don't want to exit with puppet agent's last exit code, since it uses the exit code for more than just error codes. If any of the commands we run do not exit with the exit code we are expecting, then we exit with exit code 1.","created_at":"2018-06-29T19:40:02Z","updated_at":"2018-06-29T19:40:02Z","html_url":"https://github.com/puppetlabs/ref_arch_setup/pull/22#discussion_r199261929","pull_request_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/pulls/22","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/ref_arch_setup/pulls/comments/199261929"},"html":{"href":"https://github.com/puppetlabs/ref_arch_setup/pull/22#discussion_r199261929"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/ref_arch_setup/pulls/22"}},"in_reply_to_id":197895001},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/pulls/22","id":196521377,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2NTIxMzc3","html_url":"https://github.com/puppetlabs/ref_arch_setup/pull/22","diff_url":"https://github.com/puppetlabs/ref_arch_setup/pull/22.diff","patch_url":"https://github.com/puppetlabs/ref_arch_setup/pull/22.patch","issue_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/issues/22","number":22,"state":"open","locked":false,"title":"(SLV-26) Create bolt task to install puppet enterprise","user":{"login":"samwoods1","id":4604901,"node_id":"MDQ6VXNlcjQ2MDQ5MDE=","avatar_url":"https://avatars3.githubusercontent.com/u/4604901?v=4","gravatar_id":"","url":"https://api.github.com/users/samwoods1","html_url":"https://github.com/samwoods1","followers_url":"https://api.github.com/users/samwoods1/followers","following_url":"https://api.github.com/users/samwoods1/following{/other_user}","gists_url":"https://api.github.com/users/samwoods1/gists{/gist_id}","starred_url":"https://api.github.com/users/samwoods1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samwoods1/subscriptions","organizations_url":"https://api.github.com/users/samwoods1/orgs","repos_url":"https://api.github.com/users/samwoods1/repos","events_url":"https://api.github.com/users/samwoods1/events{/privacy}","received_events_url":"https://api.github.com/users/samwoods1/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-21T17:19:27Z","updated_at":"2018-06-29T19:40:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6bf373323143b30036cf7e05bec19ff2f1d1fe2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/pulls/22/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/pulls/22/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/issues/22/comments","statuses_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/statuses/d51723ae56cee8cf6971075efea951c89a63d53f","head":{"label":"puppetlabs:install_mono","ref":"install_mono","sha":"d51723ae56cee8cf6971075efea951c89a63d53f","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":127178400,"node_id":"MDEwOlJlcG9zaXRvcnkxMjcxNzg0MDA=","name":"ref_arch_setup","full_name":"puppetlabs/ref_arch_setup","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},"private":false,"html_url":"https://github.com/puppetlabs/ref_arch_setup","description":"Tools for setting up reference architectures","fork":false,"url":"https://api.github.com/repos/puppetlabs/ref_arch_setup","forks_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/forks","keys_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/teams","hooks_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/events","assignees_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/tags","blobs_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/subscription","commits_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/merges","archive_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/downloads","issues_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/releases{/id}","deployments_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/deployments","created_at":"2018-03-28T17:57:56Z","updated_at":"2018-06-29T18:45:32Z","pushed_at":"2018-06-29T19:25:54Z","git_url":"git://github.com/puppetlabs/ref_arch_setup.git","ssh_url":"git@github.com:puppetlabs/ref_arch_setup.git","clone_url":"https://github.com/puppetlabs/ref_arch_setup.git","svn_url":"https://github.com/puppetlabs/ref_arch_setup","homepage":null,"size":79,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"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":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"d6fe0d4869f1ca4fd213a8185be76c3d7fcede9c","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":127178400,"node_id":"MDEwOlJlcG9zaXRvcnkxMjcxNzg0MDA=","name":"ref_arch_setup","full_name":"puppetlabs/ref_arch_setup","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},"private":false,"html_url":"https://github.com/puppetlabs/ref_arch_setup","description":"Tools for setting up reference architectures","fork":false,"url":"https://api.github.com/repos/puppetlabs/ref_arch_setup","forks_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/forks","keys_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/teams","hooks_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/events","assignees_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/tags","blobs_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/subscription","commits_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/merges","archive_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/downloads","issues_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/releases{/id}","deployments_url":"https://api.github.com/repos/puppetlabs/ref_arch_setup/deployments","created_at":"2018-03-28T17:57:56Z","updated_at":"2018-06-29T18:45:32Z","pushed_at":"2018-06-29T19:25:54Z","git_url":"git://github.com/puppetlabs/ref_arch_setup.git","ssh_url":"git@github.com:puppetlabs/ref_arch_setup.git","clone_url":"https://github.com/puppetlabs/ref_arch_setup.git","svn_url":"https://github.com/puppetlabs/ref_arch_setup","homepage":null,"size":79,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"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":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/ref_arch_setup/pulls/22"},"html":{"href":"https://github.com/puppetlabs/ref_arch_setup/pull/22"},"issue":{"href":"https://api.github.com/repos/puppetlabs/ref_arch_setup/issues/22"},"comments":{"href":"https://api.github.com/repos/puppetlabs/ref_arch_setup/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/ref_arch_setup/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/ref_arch_setup/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/ref_arch_setup/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/ref_arch_setup/statuses/d51723ae56cee8cf6971075efea951c89a63d53f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"samwoods1"}}