{"action":"created","comment":{"url":"https://api.github.com/repos/cerner/cerner_splunk/pulls/comments/69194419","id":69194419,"diff_hunk":"@@ -0,0 +1,90 @@\n+# coding: UTF-8\n+\n+require_relative '../spec_helper'\n+\n+describe 'cerner_splunk::_update_shcluster' do\n+  subject do\n+    runner = ChefSpec::Runner.new(step_into: ['cerner_splunk_sh_cluster']) do |node|\n+      node.set['splunk']['config']['clusters'] = ['cerner_splunk/cluster']\n+      node.set['splunk']['cmd'] = '/opt/splunk/bin/splunk'\n+      node.set['splunk']['config']['sh_member_action'] = action\n+      node.set['splunk']['package']['base_name'] = 'base_name'\n+      node.set['splunk']['package']['download_group'] = 'download_group'\n+      node.run_state['cerner_splunk'] = {}\n+      node.run_state['cerner_splunk']['admin-password'] = 'admin_password'\n+    end\n+    runner.converge('cerner_splunk::_install', 'cerner_splunk::captain', described_recipe)\n+  end\n+\n+  let(:cluster_config) do\n+    {\n+      'receivers' => ['33.33.33.20'],\n+      'license_uri' => nil,\n+      'receiver_settings' => {\n+        'splunktcp' => {\n+          'port' => '9997'\n+        }\n+      },\n+      'indexes' => 'cerner_splunk/indexes',\n+      'sh_cluster' => [\n+        'https://33.33.33.15:8089',\n+        'https://33.33.33.17:8089'\n+      ]\n+    }\n+  end\n+\n+  let(:existing_member) { nil }\n+  let(:action) { nil }\n+\n+  before do\n+    allow(Chef::DataBagItem).to receive(:load).with('cerner_splunk', 'cluster').and_return(cluster_config)\n+    allow(Chef::DataBagItem).to receive(:load).with('cerner_splunk', 'indexes').and_return({})\n+    stub_command('/opt/splunk/bin/splunk list shcluster-members -auth admin:admin_password | grep 127.0.0.1').and_return(existing_member)\n+    stub_command('/opt/splunk/bin/splunk list shcluster-members -auth admin:admin_password | grep is_captain:1').and_return(existing_member)\n+  end\n+\n+  after do\n+    CernerSplunk.reset\n+  end\n+\n+  context 'when the captain needs to be assgined' do\n+    it 'assigns the SH to be the captain' do\n+      expect(subject).to run_execute('Captain assignment')\n+    end\n+  end\n+\n+  context 'when a new member needs to be added to the cluster and is not an exisiting member of the cluster' do\n+    let(:action) { 'add' }\n+    let(:existing_member) { false }\n+\n+    it 'adds the SH to the SHC' do\n+      expect(subject).to run_execute('add search head')\n+    end\n+  end\n+\n+  context 'when a new member needs to be added to the cluster and is an exisiting member of the cluster' do","path":"spec/unit/resources/sh_cluster.rb","position":65,"original_position":65,"commit_id":"081d4d5f4dd63a24957fc0d14e08b4ca53cf52f9","original_commit_id":"081d4d5f4dd63a24957fc0d14e08b4ca53cf52f9","user":{"login":"gravesb","id":1437975,"avatar_url":"https://avatars.githubusercontent.com/u/1437975?v=3","gravatar_id":"","url":"https://api.github.com/users/gravesb","html_url":"https://github.com/gravesb","followers_url":"https://api.github.com/users/gravesb/followers","following_url":"https://api.github.com/users/gravesb/following{/other_user}","gists_url":"https://api.github.com/users/gravesb/gists{/gist_id}","starred_url":"https://api.github.com/users/gravesb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gravesb/subscriptions","organizations_url":"https://api.github.com/users/gravesb/orgs","repos_url":"https://api.github.com/users/gravesb/repos","events_url":"https://api.github.com/users/gravesb/events{/privacy}","received_events_url":"https://api.github.com/users/gravesb/received_events","type":"User","site_admin":false},"body":"is *not* an existing member","created_at":"2016-06-30T19:23:18Z","updated_at":"2016-06-30T19:23:18Z","html_url":"https://github.com/cerner/cerner_splunk/pull/124#discussion_r69194419","pull_request_url":"https://api.github.com/repos/cerner/cerner_splunk/pulls/124","_links":{"self":{"href":"https://api.github.com/repos/cerner/cerner_splunk/pulls/comments/69194419"},"html":{"href":"https://github.com/cerner/cerner_splunk/pull/124#discussion_r69194419"},"pull_request":{"href":"https://api.github.com/repos/cerner/cerner_splunk/pulls/124"}}},"pull_request":{"url":"https://api.github.com/repos/cerner/cerner_splunk/pulls/124","id":74615647,"html_url":"https://github.com/cerner/cerner_splunk/pull/124","diff_url":"https://github.com/cerner/cerner_splunk/pull/124.diff","patch_url":"https://github.com/cerner/cerner_splunk/pull/124.patch","issue_url":"https://api.github.com/repos/cerner/cerner_splunk/issues/124","number":124,"state":"open","locked":false,"title":"Add support for Search Head Clustering","user":{"login":"nmattam","id":6389596,"avatar_url":"https://avatars.githubusercontent.com/u/6389596?v=3","gravatar_id":"","url":"https://api.github.com/users/nmattam","html_url":"https://github.com/nmattam","followers_url":"https://api.github.com/users/nmattam/followers","following_url":"https://api.github.com/users/nmattam/following{/other_user}","gists_url":"https://api.github.com/users/nmattam/gists{/gist_id}","starred_url":"https://api.github.com/users/nmattam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmattam/subscriptions","organizations_url":"https://api.github.com/users/nmattam/orgs","repos_url":"https://api.github.com/users/nmattam/repos","events_url":"https://api.github.com/users/nmattam/events{/privacy}","received_events_url":"https://api.github.com/users/nmattam/received_events","type":"User","site_admin":false},"body":"This PR adds support for Search Head Clustering. \r\nhttp://docs.splunk.com/Documentation/Splunk/6.4.1/DistSearch/SHCarchitecture","created_at":"2016-06-21T13:53:58Z","updated_at":"2016-06-30T19:23:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b91fa7283c056f6703d18e51040caf891f79c981","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cerner/cerner_splunk/pulls/124/commits","review_comments_url":"https://api.github.com/repos/cerner/cerner_splunk/pulls/124/comments","review_comment_url":"https://api.github.com/repos/cerner/cerner_splunk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cerner/cerner_splunk/issues/124/comments","statuses_url":"https://api.github.com/repos/cerner/cerner_splunk/statuses/081d4d5f4dd63a24957fc0d14e08b4ca53cf52f9","head":{"label":"nmattam:sh_clustering","ref":"sh_clustering","sha":"081d4d5f4dd63a24957fc0d14e08b4ca53cf52f9","user":{"login":"nmattam","id":6389596,"avatar_url":"https://avatars.githubusercontent.com/u/6389596?v=3","gravatar_id":"","url":"https://api.github.com/users/nmattam","html_url":"https://github.com/nmattam","followers_url":"https://api.github.com/users/nmattam/followers","following_url":"https://api.github.com/users/nmattam/following{/other_user}","gists_url":"https://api.github.com/users/nmattam/gists{/gist_id}","starred_url":"https://api.github.com/users/nmattam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmattam/subscriptions","organizations_url":"https://api.github.com/users/nmattam/orgs","repos_url":"https://api.github.com/users/nmattam/repos","events_url":"https://api.github.com/users/nmattam/events{/privacy}","received_events_url":"https://api.github.com/users/nmattam/received_events","type":"User","site_admin":false},"repo":{"id":58406880,"name":"cerner_splunk","full_name":"nmattam/cerner_splunk","owner":{"login":"nmattam","id":6389596,"avatar_url":"https://avatars.githubusercontent.com/u/6389596?v=3","gravatar_id":"","url":"https://api.github.com/users/nmattam","html_url":"https://github.com/nmattam","followers_url":"https://api.github.com/users/nmattam/followers","following_url":"https://api.github.com/users/nmattam/following{/other_user}","gists_url":"https://api.github.com/users/nmattam/gists{/gist_id}","starred_url":"https://api.github.com/users/nmattam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmattam/subscriptions","organizations_url":"https://api.github.com/users/nmattam/orgs","repos_url":"https://api.github.com/users/nmattam/repos","events_url":"https://api.github.com/users/nmattam/events{/privacy}","received_events_url":"https://api.github.com/users/nmattam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nmattam/cerner_splunk","description":"Cerner's Splunk Cookbook","fork":true,"url":"https://api.github.com/repos/nmattam/cerner_splunk","forks_url":"https://api.github.com/repos/nmattam/cerner_splunk/forks","keys_url":"https://api.github.com/repos/nmattam/cerner_splunk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nmattam/cerner_splunk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nmattam/cerner_splunk/teams","hooks_url":"https://api.github.com/repos/nmattam/cerner_splunk/hooks","issue_events_url":"https://api.github.com/repos/nmattam/cerner_splunk/issues/events{/number}","events_url":"https://api.github.com/repos/nmattam/cerner_splunk/events","assignees_url":"https://api.github.com/repos/nmattam/cerner_splunk/assignees{/user}","branches_url":"https://api.github.com/repos/nmattam/cerner_splunk/branches{/branch}","tags_url":"https://api.github.com/repos/nmattam/cerner_splunk/tags","blobs_url":"https://api.github.com/repos/nmattam/cerner_splunk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nmattam/cerner_splunk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nmattam/cerner_splunk/git/refs{/sha}","trees_url":"https://api.github.com/repos/nmattam/cerner_splunk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nmattam/cerner_splunk/statuses/{sha}","languages_url":"https://api.github.com/repos/nmattam/cerner_splunk/languages","stargazers_url":"https://api.github.com/repos/nmattam/cerner_splunk/stargazers","contributors_url":"https://api.github.com/repos/nmattam/cerner_splunk/contributors","subscribers_url":"https://api.github.com/repos/nmattam/cerner_splunk/subscribers","subscription_url":"https://api.github.com/repos/nmattam/cerner_splunk/subscription","commits_url":"https://api.github.com/repos/nmattam/cerner_splunk/commits{/sha}","git_commits_url":"https://api.github.com/repos/nmattam/cerner_splunk/git/commits{/sha}","comments_url":"https://api.github.com/repos/nmattam/cerner_splunk/comments{/number}","issue_comment_url":"https://api.github.com/repos/nmattam/cerner_splunk/issues/comments{/number}","contents_url":"https://api.github.com/repos/nmattam/cerner_splunk/contents/{+path}","compare_url":"https://api.github.com/repos/nmattam/cerner_splunk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nmattam/cerner_splunk/merges","archive_url":"https://api.github.com/repos/nmattam/cerner_splunk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nmattam/cerner_splunk/downloads","issues_url":"https://api.github.com/repos/nmattam/cerner_splunk/issues{/number}","pulls_url":"https://api.github.com/repos/nmattam/cerner_splunk/pulls{/number}","milestones_url":"https://api.github.com/repos/nmattam/cerner_splunk/milestones{/number}","notifications_url":"https://api.github.com/repos/nmattam/cerner_splunk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nmattam/cerner_splunk/labels{/name}","releases_url":"https://api.github.com/repos/nmattam/cerner_splunk/releases{/id}","deployments_url":"https://api.github.com/repos/nmattam/cerner_splunk/deployments","created_at":"2016-05-09T20:44:23Z","updated_at":"2016-05-09T20:44:25Z","pushed_at":"2016-06-30T13:56:29Z","git_url":"git://github.com/nmattam/cerner_splunk.git","ssh_url":"git@github.com:nmattam/cerner_splunk.git","clone_url":"https://github.com/nmattam/cerner_splunk.git","svn_url":"https://github.com/nmattam/cerner_splunk","homepage":null,"size":291,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"stable"}},"base":{"label":"cerner:stable","ref":"stable","sha":"318f5957870b8b0364674bd4c3ba95f14da47c18","user":{"login":"cerner","id":1873208,"avatar_url":"https://avatars.githubusercontent.com/u/1873208?v=3","gravatar_id":"","url":"https://api.github.com/users/cerner","html_url":"https://github.com/cerner","followers_url":"https://api.github.com/users/cerner/followers","following_url":"https://api.github.com/users/cerner/following{/other_user}","gists_url":"https://api.github.com/users/cerner/gists{/gist_id}","starred_url":"https://api.github.com/users/cerner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cerner/subscriptions","organizations_url":"https://api.github.com/users/cerner/orgs","repos_url":"https://api.github.com/users/cerner/repos","events_url":"https://api.github.com/users/cerner/events{/privacy}","received_events_url":"https://api.github.com/users/cerner/received_events","type":"Organization","site_admin":false},"repo":{"id":24943819,"name":"cerner_splunk","full_name":"cerner/cerner_splunk","owner":{"login":"cerner","id":1873208,"avatar_url":"https://avatars.githubusercontent.com/u/1873208?v=3","gravatar_id":"","url":"https://api.github.com/users/cerner","html_url":"https://github.com/cerner","followers_url":"https://api.github.com/users/cerner/followers","following_url":"https://api.github.com/users/cerner/following{/other_user}","gists_url":"https://api.github.com/users/cerner/gists{/gist_id}","starred_url":"https://api.github.com/users/cerner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cerner/subscriptions","organizations_url":"https://api.github.com/users/cerner/orgs","repos_url":"https://api.github.com/users/cerner/repos","events_url":"https://api.github.com/users/cerner/events{/privacy}","received_events_url":"https://api.github.com/users/cerner/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cerner/cerner_splunk","description":"Cerner's Splunk Cookbook","fork":false,"url":"https://api.github.com/repos/cerner/cerner_splunk","forks_url":"https://api.github.com/repos/cerner/cerner_splunk/forks","keys_url":"https://api.github.com/repos/cerner/cerner_splunk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cerner/cerner_splunk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cerner/cerner_splunk/teams","hooks_url":"https://api.github.com/repos/cerner/cerner_splunk/hooks","issue_events_url":"https://api.github.com/repos/cerner/cerner_splunk/issues/events{/number}","events_url":"https://api.github.com/repos/cerner/cerner_splunk/events","assignees_url":"https://api.github.com/repos/cerner/cerner_splunk/assignees{/user}","branches_url":"https://api.github.com/repos/cerner/cerner_splunk/branches{/branch}","tags_url":"https://api.github.com/repos/cerner/cerner_splunk/tags","blobs_url":"https://api.github.com/repos/cerner/cerner_splunk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cerner/cerner_splunk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cerner/cerner_splunk/git/refs{/sha}","trees_url":"https://api.github.com/repos/cerner/cerner_splunk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cerner/cerner_splunk/statuses/{sha}","languages_url":"https://api.github.com/repos/cerner/cerner_splunk/languages","stargazers_url":"https://api.github.com/repos/cerner/cerner_splunk/stargazers","contributors_url":"https://api.github.com/repos/cerner/cerner_splunk/contributors","subscribers_url":"https://api.github.com/repos/cerner/cerner_splunk/subscribers","subscription_url":"https://api.github.com/repos/cerner/cerner_splunk/subscription","commits_url":"https://api.github.com/repos/cerner/cerner_splunk/commits{/sha}","git_commits_url":"https://api.github.com/repos/cerner/cerner_splunk/git/commits{/sha}","comments_url":"https://api.github.com/repos/cerner/cerner_splunk/comments{/number}","issue_comment_url":"https://api.github.com/repos/cerner/cerner_splunk/issues/comments{/number}","contents_url":"https://api.github.com/repos/cerner/cerner_splunk/contents/{+path}","compare_url":"https://api.github.com/repos/cerner/cerner_splunk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cerner/cerner_splunk/merges","archive_url":"https://api.github.com/repos/cerner/cerner_splunk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cerner/cerner_splunk/downloads","issues_url":"https://api.github.com/repos/cerner/cerner_splunk/issues{/number}","pulls_url":"https://api.github.com/repos/cerner/cerner_splunk/pulls{/number}","milestones_url":"https://api.github.com/repos/cerner/cerner_splunk/milestones{/number}","notifications_url":"https://api.github.com/repos/cerner/cerner_splunk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cerner/cerner_splunk/labels{/name}","releases_url":"https://api.github.com/repos/cerner/cerner_splunk/releases{/id}","deployments_url":"https://api.github.com/repos/cerner/cerner_splunk/deployments","created_at":"2014-10-08T14:13:04Z","updated_at":"2016-06-20T16:18:52Z","pushed_at":"2016-06-30T13:56:30Z","git_url":"git://github.com/cerner/cerner_splunk.git","ssh_url":"git@github.com:cerner/cerner_splunk.git","clone_url":"https://github.com/cerner/cerner_splunk.git","svn_url":"https://github.com/cerner/cerner_splunk","homepage":null,"size":269,"stargazers_count":10,"watchers_count":10,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":21,"forks":14,"open_issues":21,"watchers":10,"default_branch":"stable"}},"_links":{"self":{"href":"https://api.github.com/repos/cerner/cerner_splunk/pulls/124"},"html":{"href":"https://github.com/cerner/cerner_splunk/pull/124"},"issue":{"href":"https://api.github.com/repos/cerner/cerner_splunk/issues/124"},"comments":{"href":"https://api.github.com/repos/cerner/cerner_splunk/issues/124/comments"},"review_comments":{"href":"https://api.github.com/repos/cerner/cerner_splunk/pulls/124/comments"},"review_comment":{"href":"https://api.github.com/repos/cerner/cerner_splunk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cerner/cerner_splunk/pulls/124/commits"},"statuses":{"href":"https://api.github.com/repos/cerner/cerner_splunk/statuses/081d4d5f4dd63a24957fc0d14e08b4ca53cf52f9"}}}}
{"actor":{"display_login":"gravesb"}}