{"action":"created","comment":{"url":"https://api.github.com/repos/mitchellh/vagrant-google/pulls/comments/55554191","id":55554191,"diff_hunk":"@@ -25,12 +25,17 @@ def initialize(app, env)\n         end\n \n         def call(env)\n-          env[:machine_ssh_info] = read_ssh_info(env[:google_compute], env[:machine])\n+          # Get the zone we're going to use\n+          zone = env[:machine].provider_config.zone\n+          # Check if we should use public or private IP address of the instance\n+          use_private_ip = env[:machine].provider_config.get_zone_config(zone).use_private_ip\n+\n+          env[:machine_ssh_info] = read_ssh_info(env[:google_compute], env[:machine], use_private_ip)\n \n           @app.call(env)\n         end\n \n-        def read_ssh_info(google, machine)\n+        def read_ssh_info(google, machine, use_private_ip)","path":"lib/vagrant-google/action/read_ssh_info.rb","position":16,"original_position":16,"commit_id":"362ec12498e0587a6d25a448177bc71c9d6fc2f1","original_commit_id":"362ec12498e0587a6d25a448177bc71c9d6fc2f1","user":{"login":"Makdaam","id":2552733,"avatar_url":"https://avatars.githubusercontent.com/u/2552733?v=3","gravatar_id":"","url":"https://api.github.com/users/Makdaam","html_url":"https://github.com/Makdaam","followers_url":"https://api.github.com/users/Makdaam/followers","following_url":"https://api.github.com/users/Makdaam/following{/other_user}","gists_url":"https://api.github.com/users/Makdaam/gists{/gist_id}","starred_url":"https://api.github.com/users/Makdaam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Makdaam/subscriptions","organizations_url":"https://api.github.com/users/Makdaam/orgs","repos_url":"https://api.github.com/users/Makdaam/repos","events_url":"https://api.github.com/users/Makdaam/events{/privacy}","received_events_url":"https://api.github.com/users/Makdaam/received_events","type":"User","site_admin":false},"body":"It does make more sense if you have a whole zone set to use the private IP if you have a VPN setup. I'll update the branch along with adding other changes.","created_at":"2016-03-09T17:20:40Z","updated_at":"2016-03-09T17:20:40Z","html_url":"https://github.com/mitchellh/vagrant-google/pull/124#discussion_r55554191","pull_request_url":"https://api.github.com/repos/mitchellh/vagrant-google/pulls/124","_links":{"self":{"href":"https://api.github.com/repos/mitchellh/vagrant-google/pulls/comments/55554191"},"html":{"href":"https://github.com/mitchellh/vagrant-google/pull/124#discussion_r55554191"},"pull_request":{"href":"https://api.github.com/repos/mitchellh/vagrant-google/pulls/124"}}},"pull_request":{"url":"https://api.github.com/repos/mitchellh/vagrant-google/pulls/124","id":58346820,"html_url":"https://github.com/mitchellh/vagrant-google/pull/124","diff_url":"https://github.com/mitchellh/vagrant-google/pull/124.diff","patch_url":"https://github.com/mitchellh/vagrant-google/pull/124.patch","issue_url":"https://api.github.com/repos/mitchellh/vagrant-google/issues/124","number":124,"state":"open","locked":false,"title":"SSH over private IP of the GCE instance","user":{"login":"Makdaam","id":2552733,"avatar_url":"https://avatars.githubusercontent.com/u/2552733?v=3","gravatar_id":"","url":"https://api.github.com/users/Makdaam","html_url":"https://github.com/Makdaam","followers_url":"https://api.github.com/users/Makdaam/followers","following_url":"https://api.github.com/users/Makdaam/following{/other_user}","gists_url":"https://api.github.com/users/Makdaam/gists{/gist_id}","starred_url":"https://api.github.com/users/Makdaam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Makdaam/subscriptions","organizations_url":"https://api.github.com/users/Makdaam/orgs","repos_url":"https://api.github.com/users/Makdaam/repos","events_url":"https://api.github.com/users/Makdaam/events{/privacy}","received_events_url":"https://api.github.com/users/Makdaam/received_events","type":"User","site_admin":false},"body":"This adds a Boolean use_private_ip to the configurable options. Which allows to use the private IP to vagrant ssh.\r\n\r\nUse case: you have a VPN to your GCE Vagrant project and don't want to give public SSH access to your machines.\r\n\r\nTested, working, default backwards compatible.","created_at":"2016-02-04T20:50:32Z","updated_at":"2016-03-09T17:20:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5793df6605826834a37514f48488685ab850d5b1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mitchellh/vagrant-google/pulls/124/commits","review_comments_url":"https://api.github.com/repos/mitchellh/vagrant-google/pulls/124/comments","review_comment_url":"https://api.github.com/repos/mitchellh/vagrant-google/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mitchellh/vagrant-google/issues/124/comments","statuses_url":"https://api.github.com/repos/mitchellh/vagrant-google/statuses/362ec12498e0587a6d25a448177bc71c9d6fc2f1","head":{"label":"Makdaam:feature_sshprivate","ref":"feature_sshprivate","sha":"362ec12498e0587a6d25a448177bc71c9d6fc2f1","user":{"login":"Makdaam","id":2552733,"avatar_url":"https://avatars.githubusercontent.com/u/2552733?v=3","gravatar_id":"","url":"https://api.github.com/users/Makdaam","html_url":"https://github.com/Makdaam","followers_url":"https://api.github.com/users/Makdaam/followers","following_url":"https://api.github.com/users/Makdaam/following{/other_user}","gists_url":"https://api.github.com/users/Makdaam/gists{/gist_id}","starred_url":"https://api.github.com/users/Makdaam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Makdaam/subscriptions","organizations_url":"https://api.github.com/users/Makdaam/orgs","repos_url":"https://api.github.com/users/Makdaam/repos","events_url":"https://api.github.com/users/Makdaam/events{/privacy}","received_events_url":"https://api.github.com/users/Makdaam/received_events","type":"User","site_admin":false},"repo":{"id":51094934,"name":"vagrant-google","full_name":"Makdaam/vagrant-google","owner":{"login":"Makdaam","id":2552733,"avatar_url":"https://avatars.githubusercontent.com/u/2552733?v=3","gravatar_id":"","url":"https://api.github.com/users/Makdaam","html_url":"https://github.com/Makdaam","followers_url":"https://api.github.com/users/Makdaam/followers","following_url":"https://api.github.com/users/Makdaam/following{/other_user}","gists_url":"https://api.github.com/users/Makdaam/gists{/gist_id}","starred_url":"https://api.github.com/users/Makdaam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Makdaam/subscriptions","organizations_url":"https://api.github.com/users/Makdaam/orgs","repos_url":"https://api.github.com/users/Makdaam/repos","events_url":"https://api.github.com/users/Makdaam/events{/privacy}","received_events_url":"https://api.github.com/users/Makdaam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Makdaam/vagrant-google","description":"Vagrant provider for GCE.","fork":true,"url":"https://api.github.com/repos/Makdaam/vagrant-google","forks_url":"https://api.github.com/repos/Makdaam/vagrant-google/forks","keys_url":"https://api.github.com/repos/Makdaam/vagrant-google/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Makdaam/vagrant-google/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Makdaam/vagrant-google/teams","hooks_url":"https://api.github.com/repos/Makdaam/vagrant-google/hooks","issue_events_url":"https://api.github.com/repos/Makdaam/vagrant-google/issues/events{/number}","events_url":"https://api.github.com/repos/Makdaam/vagrant-google/events","assignees_url":"https://api.github.com/repos/Makdaam/vagrant-google/assignees{/user}","branches_url":"https://api.github.com/repos/Makdaam/vagrant-google/branches{/branch}","tags_url":"https://api.github.com/repos/Makdaam/vagrant-google/tags","blobs_url":"https://api.github.com/repos/Makdaam/vagrant-google/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Makdaam/vagrant-google/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Makdaam/vagrant-google/git/refs{/sha}","trees_url":"https://api.github.com/repos/Makdaam/vagrant-google/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Makdaam/vagrant-google/statuses/{sha}","languages_url":"https://api.github.com/repos/Makdaam/vagrant-google/languages","stargazers_url":"https://api.github.com/repos/Makdaam/vagrant-google/stargazers","contributors_url":"https://api.github.com/repos/Makdaam/vagrant-google/contributors","subscribers_url":"https://api.github.com/repos/Makdaam/vagrant-google/subscribers","subscription_url":"https://api.github.com/repos/Makdaam/vagrant-google/subscription","commits_url":"https://api.github.com/repos/Makdaam/vagrant-google/commits{/sha}","git_commits_url":"https://api.github.com/repos/Makdaam/vagrant-google/git/commits{/sha}","comments_url":"https://api.github.com/repos/Makdaam/vagrant-google/comments{/number}","issue_comment_url":"https://api.github.com/repos/Makdaam/vagrant-google/issues/comments{/number}","contents_url":"https://api.github.com/repos/Makdaam/vagrant-google/contents/{+path}","compare_url":"https://api.github.com/repos/Makdaam/vagrant-google/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Makdaam/vagrant-google/merges","archive_url":"https://api.github.com/repos/Makdaam/vagrant-google/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Makdaam/vagrant-google/downloads","issues_url":"https://api.github.com/repos/Makdaam/vagrant-google/issues{/number}","pulls_url":"https://api.github.com/repos/Makdaam/vagrant-google/pulls{/number}","milestones_url":"https://api.github.com/repos/Makdaam/vagrant-google/milestones{/number}","notifications_url":"https://api.github.com/repos/Makdaam/vagrant-google/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Makdaam/vagrant-google/labels{/name}","releases_url":"https://api.github.com/repos/Makdaam/vagrant-google/releases{/id}","deployments_url":"https://api.github.com/repos/Makdaam/vagrant-google/deployments","created_at":"2016-02-04T18:07:58Z","updated_at":"2016-02-04T18:07:59Z","pushed_at":"2016-02-04T20:46:34Z","git_url":"git://github.com/Makdaam/vagrant-google.git","ssh_url":"git@github.com:Makdaam/vagrant-google.git","clone_url":"https://github.com/Makdaam/vagrant-google.git","svn_url":"https://github.com/Makdaam/vagrant-google","homepage":null,"size":243,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"mitchellh:master","ref":"master","sha":"c56ca4ffbcf1c6d55a18a556b57c94f33332d994","user":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"repo":{"id":14768990,"name":"vagrant-google","full_name":"mitchellh/vagrant-google","owner":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mitchellh/vagrant-google","description":"Vagrant provider for GCE.","fork":false,"url":"https://api.github.com/repos/mitchellh/vagrant-google","forks_url":"https://api.github.com/repos/mitchellh/vagrant-google/forks","keys_url":"https://api.github.com/repos/mitchellh/vagrant-google/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mitchellh/vagrant-google/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mitchellh/vagrant-google/teams","hooks_url":"https://api.github.com/repos/mitchellh/vagrant-google/hooks","issue_events_url":"https://api.github.com/repos/mitchellh/vagrant-google/issues/events{/number}","events_url":"https://api.github.com/repos/mitchellh/vagrant-google/events","assignees_url":"https://api.github.com/repos/mitchellh/vagrant-google/assignees{/user}","branches_url":"https://api.github.com/repos/mitchellh/vagrant-google/branches{/branch}","tags_url":"https://api.github.com/repos/mitchellh/vagrant-google/tags","blobs_url":"https://api.github.com/repos/mitchellh/vagrant-google/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mitchellh/vagrant-google/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mitchellh/vagrant-google/git/refs{/sha}","trees_url":"https://api.github.com/repos/mitchellh/vagrant-google/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mitchellh/vagrant-google/statuses/{sha}","languages_url":"https://api.github.com/repos/mitchellh/vagrant-google/languages","stargazers_url":"https://api.github.com/repos/mitchellh/vagrant-google/stargazers","contributors_url":"https://api.github.com/repos/mitchellh/vagrant-google/contributors","subscribers_url":"https://api.github.com/repos/mitchellh/vagrant-google/subscribers","subscription_url":"https://api.github.com/repos/mitchellh/vagrant-google/subscription","commits_url":"https://api.github.com/repos/mitchellh/vagrant-google/commits{/sha}","git_commits_url":"https://api.github.com/repos/mitchellh/vagrant-google/git/commits{/sha}","comments_url":"https://api.github.com/repos/mitchellh/vagrant-google/comments{/number}","issue_comment_url":"https://api.github.com/repos/mitchellh/vagrant-google/issues/comments{/number}","contents_url":"https://api.github.com/repos/mitchellh/vagrant-google/contents/{+path}","compare_url":"https://api.github.com/repos/mitchellh/vagrant-google/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mitchellh/vagrant-google/merges","archive_url":"https://api.github.com/repos/mitchellh/vagrant-google/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mitchellh/vagrant-google/downloads","issues_url":"https://api.github.com/repos/mitchellh/vagrant-google/issues{/number}","pulls_url":"https://api.github.com/repos/mitchellh/vagrant-google/pulls{/number}","milestones_url":"https://api.github.com/repos/mitchellh/vagrant-google/milestones{/number}","notifications_url":"https://api.github.com/repos/mitchellh/vagrant-google/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mitchellh/vagrant-google/labels{/name}","releases_url":"https://api.github.com/repos/mitchellh/vagrant-google/releases{/id}","deployments_url":"https://api.github.com/repos/mitchellh/vagrant-google/deployments","created_at":"2013-11-28T05:51:37Z","updated_at":"2016-03-03T18:07:40Z","pushed_at":"2016-02-04T20:50:33Z","git_url":"git://github.com/mitchellh/vagrant-google.git","ssh_url":"git@github.com:mitchellh/vagrant-google.git","clone_url":"https://github.com/mitchellh/vagrant-google.git","svn_url":"https://github.com/mitchellh/vagrant-google","homepage":null,"size":267,"stargazers_count":153,"watchers_count":153,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":16,"forks":46,"open_issues":16,"watchers":153,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mitchellh/vagrant-google/pulls/124"},"html":{"href":"https://github.com/mitchellh/vagrant-google/pull/124"},"issue":{"href":"https://api.github.com/repos/mitchellh/vagrant-google/issues/124"},"comments":{"href":"https://api.github.com/repos/mitchellh/vagrant-google/issues/124/comments"},"review_comments":{"href":"https://api.github.com/repos/mitchellh/vagrant-google/pulls/124/comments"},"review_comment":{"href":"https://api.github.com/repos/mitchellh/vagrant-google/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mitchellh/vagrant-google/pulls/124/commits"},"statuses":{"href":"https://api.github.com/repos/mitchellh/vagrant-google/statuses/362ec12498e0587a6d25a448177bc71c9d6fc2f1"}}}}