Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 30 additions and 0 deletions.
  1. +1 −0 home/.gitconfig
  2. +1 −0 home/.rvc/.gitignore
  3. +28 −0 home/.rvc/bosh.rb
View
1 home/.gitconfig
@@ -9,6 +9,7 @@
[core]
excludesfile = ~/.gitignore
whitespace = trailing-space,space-before-tab
+ editor = mg
[apply]
whitespace = fix
[alias]
View
1 home/.rvc/.gitignore
@@ -0,0 +1 @@
+known_hosts
View
28 home/.rvc/bosh.rb
@@ -0,0 +1,28 @@
+require "resolv"
+
+opts :vcenter do
+ summary "Connect to bosh vCenter"
+ arg :name, "bosh instance name"
+end
+
+def vcenter name
+ deployments = ENV['CF_DEPLOYMENTS'] || "#{ENV['HOME']}/cf/deployments"
+ yml = ["micro_bosh.yml", "cloud/assets/director/director.yml.erb"].map {|f|
+ File.join(deployments, name, f)
+ }.select {|path| File.exists?(path)}.first
+ config = YAML.load(File.read(yml))['cloud']['properties']['vcenters'].first
+ begin
+ host = Resolv.new.getname(config['host'])
+ rescue
+ host = config['host']
+ end
+ dc = config['datacenters'].first
+ unless $shell.connections[host]
+ ENV['RBVMOMI_PASSWORD'] = config['password']
+ CMD.vim.connect "#{config['user']}@#{host}", {}
+ end
+ cluster_path = File.join("", host, dc['name'], "computers", dc['clusters'].first)
+ CMD.basic.cd RVC::Util.lookup_single(cluster_path)
+ensure
+ ENV['RBVMOMI_PASSWORD'] = nil
+end

No commit comments for this range

Something went wrong with that request. Please try again.