clc-chef-metal-vsphere 0.3.45 → 0.3.46
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chef_metal_vsphere/version.rb +1 -1
- data/lib/chef_metal_vsphere/vsphere_helpers.rb +16 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afbee2bf3ee8cdd745b6af36604cdc85980d24ee
|
4
|
+
data.tar.gz: 0210fbd720c027bd223bf24439aaa0cfb9cfa7c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61c4a51805b6c274244a1f0c9960a536f1e98f0547b27975e6cfe2832e17dfa452bdb532f8d2e2393bb7eac25025a69427015d1413729a6d69cc67e6784e9431
|
7
|
+
data.tar.gz: 49d78c8937bb8c83547c8d6c7195fec2ae1c1eabbe3f77267553d30b41de811bb566202889dcc399a150ab2e14499d07076513383ef98de657c652ffe6abd5cb
|
@@ -3,10 +3,24 @@ require 'rbvmomi'
|
|
3
3
|
module ChefMetalVsphere
|
4
4
|
module Helpers
|
5
5
|
|
6
|
+
if !$guest_op_managers
|
7
|
+
$guest_op_managers = {}
|
8
|
+
end
|
9
|
+
|
6
10
|
def vim(options = connect_options)
|
7
11
|
if @current_connection.nil? or @current_connection.serviceContent.sessionManager.currentSession.nil?
|
8
12
|
puts "establishing connection to #{options[:host]}"
|
9
13
|
@current_connection = RbVmomi::VIM.connect options
|
14
|
+
str_conn = @current_connection.pretty_inspect # a string in the format of VIM(host ip)
|
15
|
+
|
16
|
+
# we are caching guest operation managers in a global variable...terrible i know
|
17
|
+
# this object is available from the serviceContent object on API version 5 forward
|
18
|
+
# Its a singleton and if another connection is made for the same host and user
|
19
|
+
# that object is not available on any subsequent connection
|
20
|
+
# I could find no documentation that discusses this
|
21
|
+
if !$guest_op_managers.has_key?(str_conn)
|
22
|
+
$guest_op_managers[str_conn] = @current_connection.serviceContent.guestOperationsManager
|
23
|
+
end
|
10
24
|
end
|
11
25
|
|
12
26
|
@current_connection
|
@@ -348,6 +362,7 @@ module ChefMetalVsphere
|
|
348
362
|
:joinDomain => cust_options[:domain],
|
349
363
|
:domainAdmin => cust_options[:domainAdmin],
|
350
364
|
:domainAdminPassword => cust_domain_password)
|
365
|
+
#puts "my env passwd is: #{ENV['domainAdminPassword']}"
|
351
366
|
action_handler.report_progress "joining domain #{cust_options[:domain]} with user: #{cust_options[:domainAdmin]}"
|
352
367
|
else
|
353
368
|
cust_id = RbVmomi::VIM::CustomizationIdentification.new(
|
@@ -435,7 +450,7 @@ module ChefMetalVsphere
|
|
435
450
|
def upload_file_to_vm(vm, username, password, local, remote)
|
436
451
|
auth = RbVmomi::VIM::NamePasswordAuthentication({:username => username, :password => password, :interactiveSession => false})
|
437
452
|
size = File.size(local)
|
438
|
-
endpoint = vim.
|
453
|
+
endpoint = $guest_op_managers[vim.pretty_inspect].fileManager.InitiateFileTransferToGuest(
|
439
454
|
:vm => vm,
|
440
455
|
:auth => auth,
|
441
456
|
:guestFilePath => remote,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clc-chef-metal-vsphere
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.46
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CenturyLink Cloud
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef
|