vagrant-vcenter 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f190d95ac55ca75fe0c142093303e9ddadec651f
4
- data.tar.gz: 9ca4acd548c2cfd7d9d30049daddba701a683ed4
3
+ metadata.gz: cbc68c8b0dd49dd5af92c1aed4ddd88a470c486d
4
+ data.tar.gz: 938d2e5c277559decb8e5f2507dad4a2620465a2
5
5
  SHA512:
6
- metadata.gz: 360703f5547238533291f5f608fc27fc1363aa1de72d53aa98820b4cf8eff43ee8c7017f7080005555b782692cf182a3a60d1bf96d64ae78fb4b1c74f755bbb1
7
- data.tar.gz: 527b43a8073220b8466be2c57bad4398e09e43331e0adbf6cbc8d52f27c6beea25bff6e086ae6b50d27e93ab2f8b440e05ca7c25d0d437c45e36ec355a5524f3
6
+ metadata.gz: d9278d845e8cf8953691975a0d1519be4f12a5ffee67f5f071b2e1d05fcd119cfca25ad6ad12109d641ff22b239f21e7eb088642064549ac5e1b4efe2eb792dd
7
+ data.tar.gz: aff96e740e4bd02074e1d58c48bfd227872b4fd8a30bd2e80b501dfe10957f130f40d0febb6dd38d9c4a61e9c7a4c1ca209df6945afd827f747768db3a068213
data/README.md CHANGED
@@ -1,13 +1,18 @@
1
1
  [Vagrant](http://www.vagrantup.com) provider for VMware vCenter®
2
2
  =============
3
3
 
4
- [Version 0.1.0](../../releases/tag/v0.1.0) has been released!
4
+ [Version 0.1.1](../../releases/tag/v0.1.1) has been released!
5
5
  -------------
6
6
 
7
7
  Please note that this software is still Alpha/Beta quality and is not recommended for production usage.
8
8
 
9
9
  Right now a [Precise32](http://vagrant.gosddc.com/boxes/precise32-vcenter.box) is available for use, or you can roll your own as you please, make sure to install VMware tools in it.
10
10
 
11
+ Changes in [version 0.1.1](../../releases/tag/v0.1.1) include:
12
+
13
+ - Support for ```vagrant share``` [Fixes [#2](../../issues/2)]
14
+ - Support for [Vagrant Cloud](http://vagrantcloud.com) boxes [Fixes [#1](../../issues/1)]
15
+
11
16
  Install
12
17
  -------------
13
18
 
@@ -17,6 +22,12 @@ Latest version can be easily installed by running the following command:
17
22
 
18
23
  Vagrant will download all the required gems during the installation process.
19
24
 
25
+ If you already have the plugin installed you can use:
26
+
27
+ ```vagrant plugin upgrade vagrant-vcenter```
28
+
29
+ To perform an upgrade to the latest version.
30
+
20
31
  After the install has completed a ```vagrant up --provider=vcenter``` will trigger the newly installed provider.
21
32
 
22
33
  Configuration
@@ -22,11 +22,19 @@ module VagrantPlugins
22
22
  dc = config.vcenter_cnx.serviceInstance.find_datacenter(
23
23
  config.datacenter_name) or abort 'datacenter not found'
24
24
 
25
+ if env[:machine].box.name.to_s.include? '/'
26
+ box_file = env[:machine].box.name.rpartition('/').last.to_s
27
+ box_name = env[:machine].box.name.to_s.gsub(/\//, '-')
28
+ else
29
+ box_file = env[:machine].box.name.to_s
30
+ box_name = box_file
31
+ end
32
+
25
33
  if config.template_folder_name.nil?
26
- box_to_search = env[:machine].box.name.to_s
34
+ box_to_search = box_name
27
35
  else
28
36
  box_to_search = config.template_folder_name + '/' +
29
- env[:machine].box.name.to_s
37
+ box_name
30
38
  end
31
39
 
32
40
  # FIXME: Raise a correct exception
@@ -20,7 +20,7 @@ module VagrantPlugins
20
20
 
21
21
  @logger.debug("config.hostname: #{config.hostname}")
22
22
  @logger.debug("config.username: #{config.username}")
23
- @logger.debug("config.password: #{config.password}")
23
+ @logger.debug('config.password: <hidden>')
24
24
 
25
25
  # FIXME: fix the insecure flag, catch the exception
26
26
  config.vcenter_cnx = RbVmomi::VIM.connect(
@@ -26,7 +26,14 @@ module VagrantPlugins
26
26
  config = env[:machine].provider_config
27
27
 
28
28
  box_dir = env[:machine].box.directory.to_s
29
- box_file = env[:machine].box.name.to_s
29
+
30
+ if env[:machine].box.name.to_s.include? '/'
31
+ box_file = env[:machine].box.name.rpartition('/').last.to_s
32
+ box_name = env[:machine].box.name.to_s.gsub(/\//, '-')
33
+ else
34
+ box_file = env[:machine].box.name.to_s
35
+ box_name = box_file
36
+ end
30
37
 
31
38
  box_ovf = "file://#{box_dir}/#{box_file}.ovf"
32
39
 
@@ -35,7 +42,7 @@ module VagrantPlugins
35
42
 
36
43
  @logger.debug("OVF File: #{box_ovf}")
37
44
 
38
- env[:ui].info("Adding [#{env[:machine].box.name.to_s}]")
45
+ env[:ui].info("Adding [#{box_name}]")
39
46
 
40
47
  # FIXME: Raise a correct exception
41
48
  dc = config.vcenter_cnx.serviceInstance.find_datacenter(
@@ -51,7 +58,7 @@ module VagrantPlugins
51
58
  config.template_folder_name,
52
59
  RbVmomi::VIM::Folder)
53
60
 
54
- template_name = box_file
61
+ template_name = box_name
55
62
 
56
63
  # FIXME: Raise a correct exception
57
64
  datastore = dc.find_datastore(
@@ -91,11 +98,19 @@ module VagrantPlugins
91
98
  dc = config.vcenter_cnx.serviceInstance.find_datacenter(
92
99
  config.datacenter_name) or fail 'datacenter not found'
93
100
 
101
+ if env[:machine].box.name.to_s.include? '/'
102
+ box_file = env[:machine].box.name.rpartition('/').last.to_s
103
+ box_name = env[:machine].box.name.to_s.gsub(/\//, '-')
104
+ else
105
+ box_file = env[:machine].box.name.to_s
106
+ box_name = box_file
107
+ end
108
+
94
109
  if config.template_folder_name.nil?
95
- box_to_search = env[:machine].box.name.to_s
110
+ box_to_search = box_name
96
111
  else
97
112
  box_to_search = config.template_folder_name +
98
- '/' + env[:machine].box.name.to_s
113
+ '/' + box_name
99
114
  end
100
115
 
101
116
  @logger.debug("This is the box we're looking for: #{box_to_search}")
@@ -103,16 +118,16 @@ module VagrantPlugins
103
118
  config.template_id = dc.find_vm(box_to_search)
104
119
 
105
120
  if config.template_id.nil?
106
- env[:ui].warn("Template [#{env[:machine].box.name.to_s}] " +
121
+ env[:ui].warn("Template [#{box_name}] " +
107
122
  'does not exist!')
108
123
 
109
124
  user_input = env[:ui].ask(
110
- "Would you like to upload the [#{env[:machine].box.name.to_s}]" +
125
+ "Would you like to upload the [#{box_name}]" +
111
126
  " box?\nChoice (yes/no): "
112
127
  )
113
128
 
114
129
  if user_input.downcase == 'yes' || user_input.downcase == 'y'
115
- env[:ui].info("Uploading [#{env[:machine].box.name.to_s}]...")
130
+ env[:ui].info("Uploading [#{box_name}]...")
116
131
  vcenter_upload_box(env)
117
132
  else
118
133
  env[:ui].error('Template not uploaded, exiting...')
@@ -0,0 +1,18 @@
1
+ module VagrantPlugins
2
+ module VCenter
3
+ module Cap
4
+ module PublicAddress
5
+ def self.public_address(machine)
6
+ # Initial try for vagrant share feature.
7
+ # It seems ssh_info[:port] is given automatically.
8
+ # I think this feature was built planning that the port forwarding
9
+ # and networking was done on the vagrant machine, which isn't the
10
+ # case in vagrant-vcloud
11
+
12
+ ssh_info = machine.ssh_info
13
+ ssh_info[:host]
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -12,7 +12,7 @@ module VagrantPlugins
12
12
  module VCenter
13
13
  # Initialize Vagrant Plugin
14
14
  class Plugin < Vagrant.plugin('2')
15
- name 'vCenter'
15
+ name 'VMware vCenter Provider'
16
16
  description 'Allows Vagrant to manage machines with VMware vCenter (R)'
17
17
 
18
18
  config(:vcenter, :provider) do
@@ -29,6 +29,12 @@ module VagrantPlugins
29
29
  Provider
30
30
  end
31
31
 
32
+ # Add vagrant share support
33
+ provider_capability('vcenter', 'public_address') do
34
+ require_relative 'cap/public_address'
35
+ Cap::PublicAddress
36
+ end
37
+
32
38
  def self.setup_i18n
33
39
  I18n.load_path << File.expand_path('locales/en.yml',
34
40
  VCenter.source_root)
@@ -1,6 +1,6 @@
1
1
  module VagrantPlugins
2
2
  # Set version for vagrant-vcenter gem.
3
3
  module VCenter
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-vcenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Rapposelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-27 00:00:00.000000000 Z
11
+ date: 2014-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vagrant-rbvmomi
@@ -159,6 +159,7 @@ files:
159
159
  - lib/vagrant-vcenter/action/resume.rb
160
160
  - lib/vagrant-vcenter/action/suspend.rb
161
161
  - lib/vagrant-vcenter/action/sync_folders.rb
162
+ - lib/vagrant-vcenter/cap/public_address.rb
162
163
  - lib/vagrant-vcenter/config.rb
163
164
  - lib/vagrant-vcenter/errors.rb
164
165
  - lib/vagrant-vcenter/plugin.rb