{"action":"created","comment":{"url":"https://api.github.com/repos/schubergphilis/MCT-shared/pulls/comments/43997605","id":43997605,"diff_hunk":"@@ -0,0 +1,83 @@\n+#!/bin/bash\n+\n+# We get this passed from the main script\n+NSX_MANAGER=$1\n+NSX_CONTROLLER=$2\n+NSX_SERVICE=$3\n+KVM_HOST=$4\n+\n+NSX_CONTROLLER_IP=$(getent hosts ${NSX_CONTROLLER} | awk '{ print $1 }')\n+NSX_SERVICE_IP=$(getent hosts ${NSX_SERVICE} | awk '{ print $1 }')\n+KVM_HOST_IP=$(getent hosts ${KVM_HOST} | awk '{ print $1 }')\n+\n+# Wait for controller to be responding\n+while ! ping -c3 ${NSX_CONTROLLER} &>/dev/null; do\n+  sleep 2\n+done\n+\n+SSH_OPTIONS=\"-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -q\"\n+\n+# Create cluster\n+echo \"Note: Creating NSX cluster\"\n+sudo yum install -y -q sshpass\n+sshpass -p 'admin' ssh ${SSH_OPTIONS} admin@${NSX_CONTROLLER_IP} join control-cluster ${NSX_CONTROLLER_IP}\n+sshpass -p 'admin' ssh ${SSH_OPTIONS} admin@${NSX_SERVICE_IP} set switch manager-cluster ${NSX_CONTROLLER_IP}\n+\n+# login to controller\n+echo \"Note: Authenticating against controller\"\n+curl -k -c cookie.txt -X POST -d 'username=admin&password=admin' https://${NSX_CONTROLLER}/ws.v1/login","path":"deploy/post_deploy/nsx_cluster.sh","position":28,"original_position":28,"commit_id":"db176a26134ace3e941a7384faad921e1dcc5011","original_commit_id":"db176a26134ace3e941a7384faad921e1dcc5011","user":{"login":"miguelaferreira","id":4670993,"avatar_url":"https://avatars.githubusercontent.com/u/4670993?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelaferreira","html_url":"https://github.com/miguelaferreira","followers_url":"https://api.github.com/users/miguelaferreira/followers","following_url":"https://api.github.com/users/miguelaferreira/following{/other_user}","gists_url":"https://api.github.com/users/miguelaferreira/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelaferreira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelaferreira/subscriptions","organizations_url":"https://api.github.com/users/miguelaferreira/orgs","repos_url":"https://api.github.com/users/miguelaferreira/repos","events_url":"https://api.github.com/users/miguelaferreira/events{/privacy}","received_events_url":"https://api.github.com/users/miguelaferreira/received_events","type":"User","site_admin":false},"body":"The configs do not specify the passwords, therefore the default password is hardcoded.\r\nNot ideal!","created_at":"2015-11-05T10:39:28Z","updated_at":"2015-11-05T10:39:28Z","html_url":"https://github.com/schubergphilis/MCT-shared/pull/26#discussion_r43997605","pull_request_url":"https://api.github.com/repos/schubergphilis/MCT-shared/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/schubergphilis/MCT-shared/pulls/comments/43997605"},"html":{"href":"https://github.com/schubergphilis/MCT-shared/pull/26#discussion_r43997605"},"pull_request":{"href":"https://api.github.com/repos/schubergphilis/MCT-shared/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/schubergphilis/MCT-shared/pulls/26","id":48873751,"html_url":"https://github.com/schubergphilis/MCT-shared/pull/26","diff_url":"https://github.com/schubergphilis/MCT-shared/pull/26.diff","patch_url":"https://github.com/schubergphilis/MCT-shared/pull/26.patch","issue_url":"https://api.github.com/repos/schubergphilis/MCT-shared/issues/26","number":26,"state":"open","locked":false,"title":"Add new controller to cluster NSX","user":{"login":"miguelaferreira","id":4670993,"avatar_url":"https://avatars.githubusercontent.com/u/4670993?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelaferreira","html_url":"https://github.com/miguelaferreira","followers_url":"https://api.github.com/users/miguelaferreira/followers","following_url":"https://api.github.com/users/miguelaferreira/following{/other_user}","gists_url":"https://api.github.com/users/miguelaferreira/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelaferreira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelaferreira/subscriptions","organizations_url":"https://api.github.com/users/miguelaferreira/orgs","repos_url":"https://api.github.com/users/miguelaferreira/repos","events_url":"https://api.github.com/users/miguelaferreira/events{/privacy}","received_events_url":"https://api.github.com/users/miguelaferreira/received_events","type":"User","site_admin":false},"body":"This PR adds a new role to add a new NSX controller to a cluster. The cluster is the first one added by the cloud config `nsx_cluster`.\r\n\r\nAdding controllers to other clusters would require a new role.\r\n\r\nThis PR builds on top of a PR #25 ","created_at":"2015-10-27T13:59:25Z","updated_at":"2015-11-05T10:39:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cadcd32e4f68ce5988ec2bf46e4d90cd205149b0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/schubergphilis/MCT-shared/pulls/26/commits","review_comments_url":"https://api.github.com/repos/schubergphilis/MCT-shared/pulls/26/comments","review_comment_url":"https://api.github.com/repos/schubergphilis/MCT-shared/pulls/comments{/number}","comments_url":"https://api.github.com/repos/schubergphilis/MCT-shared/issues/26/comments","statuses_url":"https://api.github.com/repos/schubergphilis/MCT-shared/statuses/db176a26134ace3e941a7384faad921e1dcc5011","head":{"label":"miguelaferreira:nsx-controller-in-cluster","ref":"nsx-controller-in-cluster","sha":"db176a26134ace3e941a7384faad921e1dcc5011","user":{"login":"miguelaferreira","id":4670993,"avatar_url":"https://avatars.githubusercontent.com/u/4670993?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelaferreira","html_url":"https://github.com/miguelaferreira","followers_url":"https://api.github.com/users/miguelaferreira/followers","following_url":"https://api.github.com/users/miguelaferreira/following{/other_user}","gists_url":"https://api.github.com/users/miguelaferreira/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelaferreira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelaferreira/subscriptions","organizations_url":"https://api.github.com/users/miguelaferreira/orgs","repos_url":"https://api.github.com/users/miguelaferreira/repos","events_url":"https://api.github.com/users/miguelaferreira/events{/privacy}","received_events_url":"https://api.github.com/users/miguelaferreira/received_events","type":"User","site_admin":false},"repo":{"id":41356224,"name":"MCT-shared","full_name":"miguelaferreira/MCT-shared","owner":{"login":"miguelaferreira","id":4670993,"avatar_url":"https://avatars.githubusercontent.com/u/4670993?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelaferreira","html_url":"https://github.com/miguelaferreira","followers_url":"https://api.github.com/users/miguelaferreira/followers","following_url":"https://api.github.com/users/miguelaferreira/following{/other_user}","gists_url":"https://api.github.com/users/miguelaferreira/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelaferreira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelaferreira/subscriptions","organizations_url":"https://api.github.com/users/miguelaferreira/orgs","repos_url":"https://api.github.com/users/miguelaferreira/repos","events_url":"https://api.github.com/users/miguelaferreira/events{/privacy}","received_events_url":"https://api.github.com/users/miguelaferreira/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/miguelaferreira/MCT-shared","description":"Shared repo for our MCT CloudStack environment","fork":true,"url":"https://api.github.com/repos/miguelaferreira/MCT-shared","forks_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/forks","keys_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/keys{/key_id}","collaborators_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/teams","hooks_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/hooks","issue_events_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/issues/events{/number}","events_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/events","assignees_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/assignees{/user}","branches_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/branches{/branch}","tags_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/tags","blobs_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/git/refs{/sha}","trees_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/git/trees{/sha}","statuses_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/statuses/{sha}","languages_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/languages","stargazers_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/stargazers","contributors_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/contributors","subscribers_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/subscribers","subscription_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/subscription","commits_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/commits{/sha}","git_commits_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/git/commits{/sha}","comments_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/comments{/number}","issue_comment_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/issues/comments{/number}","contents_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/contents/{+path}","compare_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/compare/{base}...{head}","merges_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/merges","archive_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/downloads","issues_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/issues{/number}","pulls_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/pulls{/number}","milestones_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/milestones{/number}","notifications_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/labels{/name}","releases_url":"https://api.github.com/repos/miguelaferreira/MCT-shared/releases{/id}","created_at":"2015-08-25T09:49:13Z","updated_at":"2015-08-25T09:49:13Z","pushed_at":"2015-11-05T09:58:54Z","git_url":"git://github.com/miguelaferreira/MCT-shared.git","ssh_url":"git@github.com:miguelaferreira/MCT-shared.git","clone_url":"https://github.com/miguelaferreira/MCT-shared.git","svn_url":"https://github.com/miguelaferreira/MCT-shared","homepage":null,"size":721,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"schubergphilis:master","ref":"master","sha":"1975c47a6bde2f10b21ca479893dbfde705ee832","user":{"login":"schubergphilis","id":864482,"avatar_url":"https://avatars.githubusercontent.com/u/864482?v=3","gravatar_id":"","url":"https://api.github.com/users/schubergphilis","html_url":"https://github.com/schubergphilis","followers_url":"https://api.github.com/users/schubergphilis/followers","following_url":"https://api.github.com/users/schubergphilis/following{/other_user}","gists_url":"https://api.github.com/users/schubergphilis/gists{/gist_id}","starred_url":"https://api.github.com/users/schubergphilis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schubergphilis/subscriptions","organizations_url":"https://api.github.com/users/schubergphilis/orgs","repos_url":"https://api.github.com/users/schubergphilis/repos","events_url":"https://api.github.com/users/schubergphilis/events{/privacy}","received_events_url":"https://api.github.com/users/schubergphilis/received_events","type":"Organization","site_admin":false},"repo":{"id":34800489,"name":"MCT-shared","full_name":"schubergphilis/MCT-shared","owner":{"login":"schubergphilis","id":864482,"avatar_url":"https://avatars.githubusercontent.com/u/864482?v=3","gravatar_id":"","url":"https://api.github.com/users/schubergphilis","html_url":"https://github.com/schubergphilis","followers_url":"https://api.github.com/users/schubergphilis/followers","following_url":"https://api.github.com/users/schubergphilis/following{/other_user}","gists_url":"https://api.github.com/users/schubergphilis/gists{/gist_id}","starred_url":"https://api.github.com/users/schubergphilis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schubergphilis/subscriptions","organizations_url":"https://api.github.com/users/schubergphilis/orgs","repos_url":"https://api.github.com/users/schubergphilis/repos","events_url":"https://api.github.com/users/schubergphilis/events{/privacy}","received_events_url":"https://api.github.com/users/schubergphilis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/schubergphilis/MCT-shared","description":"Shared repo for our MCT CloudStack environment","fork":false,"url":"https://api.github.com/repos/schubergphilis/MCT-shared","forks_url":"https://api.github.com/repos/schubergphilis/MCT-shared/forks","keys_url":"https://api.github.com/repos/schubergphilis/MCT-shared/keys{/key_id}","collaborators_url":"https://api.github.com/repos/schubergphilis/MCT-shared/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/schubergphilis/MCT-shared/teams","hooks_url":"https://api.github.com/repos/schubergphilis/MCT-shared/hooks","issue_events_url":"https://api.github.com/repos/schubergphilis/MCT-shared/issues/events{/number}","events_url":"https://api.github.com/repos/schubergphilis/MCT-shared/events","assignees_url":"https://api.github.com/repos/schubergphilis/MCT-shared/assignees{/user}","branches_url":"https://api.github.com/repos/schubergphilis/MCT-shared/branches{/branch}","tags_url":"https://api.github.com/repos/schubergphilis/MCT-shared/tags","blobs_url":"https://api.github.com/repos/schubergphilis/MCT-shared/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/schubergphilis/MCT-shared/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/schubergphilis/MCT-shared/git/refs{/sha}","trees_url":"https://api.github.com/repos/schubergphilis/MCT-shared/git/trees{/sha}","statuses_url":"https://api.github.com/repos/schubergphilis/MCT-shared/statuses/{sha}","languages_url":"https://api.github.com/repos/schubergphilis/MCT-shared/languages","stargazers_url":"https://api.github.com/repos/schubergphilis/MCT-shared/stargazers","contributors_url":"https://api.github.com/repos/schubergphilis/MCT-shared/contributors","subscribers_url":"https://api.github.com/repos/schubergphilis/MCT-shared/subscribers","subscription_url":"https://api.github.com/repos/schubergphilis/MCT-shared/subscription","commits_url":"https://api.github.com/repos/schubergphilis/MCT-shared/commits{/sha}","git_commits_url":"https://api.github.com/repos/schubergphilis/MCT-shared/git/commits{/sha}","comments_url":"https://api.github.com/repos/schubergphilis/MCT-shared/comments{/number}","issue_comment_url":"https://api.github.com/repos/schubergphilis/MCT-shared/issues/comments{/number}","contents_url":"https://api.github.com/repos/schubergphilis/MCT-shared/contents/{+path}","compare_url":"https://api.github.com/repos/schubergphilis/MCT-shared/compare/{base}...{head}","merges_url":"https://api.github.com/repos/schubergphilis/MCT-shared/merges","archive_url":"https://api.github.com/repos/schubergphilis/MCT-shared/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/schubergphilis/MCT-shared/downloads","issues_url":"https://api.github.com/repos/schubergphilis/MCT-shared/issues{/number}","pulls_url":"https://api.github.com/repos/schubergphilis/MCT-shared/pulls{/number}","milestones_url":"https://api.github.com/repos/schubergphilis/MCT-shared/milestones{/number}","notifications_url":"https://api.github.com/repos/schubergphilis/MCT-shared/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/schubergphilis/MCT-shared/labels{/name}","releases_url":"https://api.github.com/repos/schubergphilis/MCT-shared/releases{/id}","created_at":"2015-04-29T15:02:53Z","updated_at":"2015-09-27T11:47:43Z","pushed_at":"2015-11-04T15:51:31Z","git_url":"git://github.com/schubergphilis/MCT-shared.git","ssh_url":"git@github.com:schubergphilis/MCT-shared.git","clone_url":"https://github.com/schubergphilis/MCT-shared.git","svn_url":"https://github.com/schubergphilis/MCT-shared","homepage":null,"size":1402,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/schubergphilis/MCT-shared/pulls/26"},"html":{"href":"https://github.com/schubergphilis/MCT-shared/pull/26"},"issue":{"href":"https://api.github.com/repos/schubergphilis/MCT-shared/issues/26"},"comments":{"href":"https://api.github.com/repos/schubergphilis/MCT-shared/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/schubergphilis/MCT-shared/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/schubergphilis/MCT-shared/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/schubergphilis/MCT-shared/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/schubergphilis/MCT-shared/statuses/db176a26134ace3e941a7384faad921e1dcc5011"}}}}