vagrant-vcenter 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +67 -34
- data/lib/vagrant-vcenter/action.rb +15 -5
- data/lib/vagrant-vcenter/action/build_vm.rb +56 -18
- data/lib/vagrant-vcenter/action/is_created.rb +25 -0
- data/lib/vagrant-vcenter/action/prepare_nfs_settings.rb +25 -0
- data/lib/vagrant-vcenter/action/read_ssh_info.rb +3 -0
- data/lib/vagrant-vcenter/action/read_state.rb +6 -6
- data/lib/vagrant-vcenter/cap/rdp_info.rb +15 -0
- data/lib/vagrant-vcenter/cap/winrm_info.rb +15 -0
- data/lib/vagrant-vcenter/config.rb +0 -60
- data/lib/vagrant-vcenter/plugin.rb +15 -3
- data/lib/vagrant-vcenter/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2264128e77dfd3e5e1f5e880ac6dcabb569fc195
|
4
|
+
data.tar.gz: c5f2970dbea8a657c625615e1710892b39e18faf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c280d8d1253ce45f7e1f36321d74180467c5667c1a1cd2ff0ee5633f5ab6298a81be977980677f8ad64cc47539a842e16ff46a1665d729e3114fa56ccd2b6b6e
|
7
|
+
data.tar.gz: 9d204f9681ec690210e098e50ed3922164d5ea78e5021709228394f6d3a341ddcdd5bf41d8e8591fd3a2de5607643b31b4107072b691da0ef98f8aecc1d68812
|
data/README.md
CHANGED
@@ -1,21 +1,24 @@
|
|
1
1
|
[Vagrant](http://www.vagrantup.com) provider for VMware vCenter®
|
2
2
|
=============
|
3
3
|
|
4
|
-
[Version 0.
|
4
|
+
[Version 0.3.0](../../releases/tag/v0.3.0) 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
|
We have a wide array of boxes available at [Vagrant Cloud](https://vagrantcloud.com/gosddc) you can use them directly or you can roll your own as you please, make sure to install VMware tools in it.
|
10
10
|
|
11
|
-
|
11
|
+
This plugin supports the universal [```vmware_ovf``` box format](https://github.com/gosddc/packer-post-processor-vagrant-vmware-ovf/wiki/vmware_ovf-Box-Format), that is 100% portable between [vagrant-vcloud](https://github.com/frapposelli/vagrant-vcloud), [vagrant-vcenter](https://github.com/gosddc/vagrant-vcenter) and [vagrant-vcloudair](https://github.com/gosddc/vagrant-vcloudair), no more double boxes!.
|
12
12
|
|
13
|
-
|
13
|
+
Changes in [version 0.3.0](../../releases/tag/v0.3.0) include:
|
14
14
|
|
15
|
-
|
16
|
-
- Checking the power state at that spot can cause ruby exceptions to be thrown.
|
15
|
+
Fixes
|
17
16
|
|
18
|
-
|
17
|
+
- ```vmware_ovf``` support!
|
18
|
+
- You can now specify network using the ```public_network``` notation of Vagrant.
|
19
|
+
- Plugin is now operating in parallel, MOAR SPEED!
|
20
|
+
- Create the VM folder if it doesn't exist.
|
21
|
+
- Several bug fixes.
|
19
22
|
|
20
23
|
Install
|
21
24
|
-------------
|
@@ -40,44 +43,74 @@ Configuration
|
|
40
43
|
Here's a sample Multi-VM Vagrantfile:
|
41
44
|
|
42
45
|
```ruby
|
43
|
-
|
44
|
-
{ hostname: 'web-vm', box: 'gosddc/precise32' },
|
45
|
-
{ hostname: 'ssh-vm', box: 'gosddc/precise32' },
|
46
|
-
{ hostname: 'sql-vm', box: 'gosddc/precise32' },
|
47
|
-
{ hostname: 'lb-vm', box: 'gosddc/precise32' }
|
48
|
-
]
|
46
|
+
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'vcenter'
|
49
47
|
|
50
|
-
|
48
|
+
nodes = []
|
51
49
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
50
|
+
[*1..5].each do |n|
|
51
|
+
nodes << { hostname: "centos#{n}",
|
52
|
+
box: 'gosddc/centos65-x64',
|
53
|
+
ip: "10.250.21.#{n}",
|
54
|
+
mem: 1024 * n,
|
55
|
+
cpu: n }
|
56
|
+
end
|
57
|
+
|
58
|
+
[*1..5].each do |n|
|
59
|
+
nodes << { hostname: "precise#{n}",
|
60
|
+
box: 'gosddc/precise32',
|
61
|
+
ip: "10.250.22.#{n}",
|
62
|
+
mem: 1024 * n,
|
63
|
+
cpu: n }
|
64
|
+
end
|
65
65
|
|
66
|
-
|
66
|
+
Vagrant.configure('2') do |config|
|
67
|
+
|
68
|
+
# Go through nodes and configure each of them.
|
67
69
|
nodes.each do |node|
|
70
|
+
|
71
|
+
config.vm.provider :vcenter do |vcenter|
|
72
|
+
vcenter.hostname = 'my.vcenter.hostname'
|
73
|
+
vcenter.username = 'myUsername'
|
74
|
+
vcenter.password = 'myPassword'
|
75
|
+
vcenter.folder_name = 'myFolderName'
|
76
|
+
vcenter.datacenter_name = 'MyDatacenterName'
|
77
|
+
vcenter.computer_name = 'MyHostOrCluster'
|
78
|
+
vcenter.datastore_name = 'MyDatastore'
|
79
|
+
vcenter.network_name = 'myNetworkName'
|
80
|
+
vcenter.linked_clones = true
|
81
|
+
end
|
82
|
+
|
68
83
|
config.vm.define node[:hostname] do |node_config|
|
69
84
|
node_config.vm.box = node[:box]
|
70
85
|
node_config.vm.hostname = node[:hostname]
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
86
|
+
|
87
|
+
# Let's configure the network for the VM, only the ip changes and is
|
88
|
+
# coming from the nodes array
|
89
|
+
node_config.vm.network :public_network,
|
90
|
+
ip: node[:ip],
|
91
|
+
netmask: '255.255.0.0',
|
92
|
+
gateway: '10.250.254.254',
|
93
|
+
dns_server_list: ['8.8.4.4', '8.8.8.8'],
|
94
|
+
dns_suffix_list: ['ad.lab.gosddc.com']
|
95
|
+
|
96
|
+
# Let's override some provider settings for specific VMs
|
97
|
+
node_config.vm.provider :vcenter do |override|
|
98
|
+
# Override number of cpu and memory based on what's in the nodes array
|
99
|
+
override.num_cpu = node[:cpu]
|
100
|
+
override.memory = node[:mem]
|
101
|
+
case node[:hostname]
|
102
|
+
# Override the folder name based on the hostname of the VM
|
103
|
+
when /centos/
|
104
|
+
override.folder_name = 'Vagrant/centos'
|
105
|
+
when /precise/
|
106
|
+
override.folder_name = 'Vagrant/ubuntu/precise'
|
107
|
+
end
|
108
|
+
end
|
109
|
+
node_config.nfs.functional = false
|
78
110
|
end
|
79
111
|
end
|
80
112
|
end
|
113
|
+
|
81
114
|
```
|
82
115
|
|
83
116
|
Contribute
|
@@ -13,6 +13,7 @@ module VagrantPlugins
|
|
13
13
|
def self.action_boot
|
14
14
|
Vagrant::Action::Builder.new.tap do |b|
|
15
15
|
b.use PowerOn
|
16
|
+
b.use PrepareNFSSettings
|
16
17
|
b.use Provision
|
17
18
|
b.use SyncedFolders
|
18
19
|
end
|
@@ -93,10 +94,16 @@ module VagrantPlugins
|
|
93
94
|
if env[:result]
|
94
95
|
b2.use ConfigValidate
|
95
96
|
b2.use ConnectvCenter
|
96
|
-
b2.use Call,
|
97
|
-
|
98
|
-
|
99
|
-
|
97
|
+
b2.use Call, IsCreated do |env2, b3|
|
98
|
+
unless env2[:result]
|
99
|
+
b3.use MessageNotCreated
|
100
|
+
next
|
101
|
+
end
|
102
|
+
b3.use Call, IsRunning do |env3, b4|
|
103
|
+
# If the VM is running, must power off
|
104
|
+
b4.use action_halt if env3[:result]
|
105
|
+
b4.use Destroy
|
106
|
+
end
|
100
107
|
end
|
101
108
|
else
|
102
109
|
b2.use MessageWillNotDestroy
|
@@ -113,6 +120,7 @@ module VagrantPlugins
|
|
113
120
|
b2.use MessageNotCreated
|
114
121
|
next
|
115
122
|
end
|
123
|
+
b2.use PrepareNFSSettings
|
116
124
|
b2.use Provision
|
117
125
|
b2.use SyncedFolders
|
118
126
|
end
|
@@ -170,10 +178,10 @@ module VagrantPlugins
|
|
170
178
|
def self.action_up
|
171
179
|
Vagrant::Action::Builder.new.tap do |b|
|
172
180
|
b.use ConfigValidate
|
181
|
+
b.use ConnectvCenter
|
173
182
|
b.use Call, IsCreated do |env, b2|
|
174
183
|
b2.use HandleBox unless env[:result]
|
175
184
|
end
|
176
|
-
b.use ConnectvCenter
|
177
185
|
b.use InventoryCheck
|
178
186
|
b.use Call, IsCreated do |env, b2|
|
179
187
|
b2.use BuildVM unless env[:result]
|
@@ -216,6 +224,8 @@ module VagrantPlugins
|
|
216
224
|
action_root.join('power_off')
|
217
225
|
autoload :PowerOn,
|
218
226
|
action_root.join('power_on')
|
227
|
+
autoload :PrepareNFSSettings,
|
228
|
+
action_root.join('prepare_nfs_settings')
|
219
229
|
autoload :ReadSSHInfo,
|
220
230
|
action_root.join('read_ssh_info')
|
221
231
|
autoload :ReadState,
|
@@ -116,34 +116,61 @@ module VagrantPlugins
|
|
116
116
|
dev_spec = RbVmomi::VIM.VirtualDeviceConfigSpec(:device => card, :operation => "edit")
|
117
117
|
config_spec.deviceChange = [dev_spec]
|
118
118
|
end
|
119
|
-
|
119
|
+
|
120
120
|
spec.config = config_spec
|
121
121
|
end
|
122
122
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
123
|
+
public_networks = env[:machine].config.vm.networks.select {
|
124
|
+
|n| n[0].eql? :public_network
|
125
|
+
}
|
126
|
+
|
127
|
+
network_spec = public_networks.first[1]
|
128
|
+
|
129
|
+
@logger.debug("This is our network #{public_networks.inspect}")
|
130
|
+
|
131
|
+
if network_spec
|
132
|
+
|
133
|
+
# Check for sanity and validation of network parameters.
|
134
|
+
|
135
|
+
# Specify ip but no netmask
|
136
|
+
if network_spec[:ip] && !network_spec[:netmask]
|
137
|
+
fail Errors::WrongNetworkSpec
|
138
|
+
end
|
139
|
+
|
140
|
+
# specify netmask but no ip
|
141
|
+
if !network_spec[:ip] && network_spec[:netmask]
|
142
|
+
fail Errors::WrongNetworkSpec
|
143
|
+
end
|
144
|
+
|
145
|
+
global_ip_settings = RbVmomi::VIM.CustomizationGlobalIPSettings(
|
146
|
+
:dnsServerList => network_spec[:dns_server_list],
|
147
|
+
:dnsSuffixList => network_spec[:dns_suffix_list])
|
127
148
|
|
128
149
|
prep = RbVmomi::VIM.CustomizationLinuxPrep(
|
129
|
-
:domain => env[:machine].name.to_s.sub(/^[^.]+\./,''),
|
150
|
+
:domain => env[:machine].name.to_s.sub(/^[^.]+\./, ''),
|
130
151
|
:hostName => RbVmomi::VIM.CustomizationFixedName(
|
131
152
|
:name => env[:machine].name.to_s.split('.')[0]))
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
153
|
+
|
154
|
+
# if no ip and no netmask, let's default to dhcp
|
155
|
+
if !network_spec[:ip] && !network_spec[:netmask]
|
156
|
+
adapter = RbVmomi::VIM.CustomizationIPSettings(
|
157
|
+
:ip => RbVmomi::VIM.CustomizationDhcpIpGenerator())
|
158
|
+
else
|
159
|
+
adapter = RbVmomi::VIM.CustomizationIPSettings(
|
160
|
+
:gateway => [network_spec[:gateway]],
|
161
|
+
:ip => RbVmomi::VIM.CustomizationFixedIp(
|
162
|
+
:ipAddress => network_spec[:ip]),
|
163
|
+
:subnetMask => network_spec[:netmask])
|
164
|
+
end
|
165
|
+
|
139
166
|
nic_map = [RbVmomi::VIM.CustomizationAdapterMapping(
|
140
167
|
:adapter => adapter)]
|
141
168
|
|
142
169
|
cust_spec = RbVmomi::VIM.CustomizationSpec(
|
143
|
-
:globalIPSettings =>
|
170
|
+
:globalIPSettings => global_ip_settings,
|
144
171
|
:identity => prep,
|
145
172
|
:nicSettingMap => nic_map)
|
146
|
-
|
173
|
+
|
147
174
|
spec.customization = cust_spec
|
148
175
|
end
|
149
176
|
|
@@ -151,7 +178,7 @@ module VagrantPlugins
|
|
151
178
|
|
152
179
|
@logger.debug("disable_auto_vm_name: #{config.disable_auto_vm_name}")
|
153
180
|
|
154
|
-
if config.disable_auto_vm_name
|
181
|
+
if config.disable_auto_vm_name || config.disable_auto_vm_name == 'true'
|
155
182
|
vm_target = vm_name.to_s
|
156
183
|
else
|
157
184
|
vm_target = "Vagrant-#{Etc.getlogin}-" +
|
@@ -167,8 +194,19 @@ module VagrantPlugins
|
|
167
194
|
root_vm_folder = dc.vmFolder
|
168
195
|
vm_folder = root_vm_folder
|
169
196
|
unless config.folder_name.nil?
|
170
|
-
|
171
|
-
|
197
|
+
begin
|
198
|
+
# Better ask for forgiveness than permission ;-)
|
199
|
+
@logger.debug("Creating folder #{config.folder_name}.")
|
200
|
+
vm_folder = root_vm_folder.traverse(config.folder_name,
|
201
|
+
RbVmomi::VIM::Folder,
|
202
|
+
create = true)
|
203
|
+
# FIXME: we should trap the correct exception
|
204
|
+
rescue RbVmomi::Fault
|
205
|
+
# if somebody else created the folder already...
|
206
|
+
@logger.debug("Folder #{config.folder_name} already exists.")
|
207
|
+
vm_folder = root_vm_folder.traverse(config.folder_name,
|
208
|
+
RbVmomi::VIM::Folder)
|
209
|
+
end
|
172
210
|
end
|
173
211
|
@logger.debug("folder for VM: #{vm_folder}")
|
174
212
|
|
@@ -11,9 +11,34 @@ module VagrantPlugins
|
|
11
11
|
def call(env)
|
12
12
|
vm_id = env[:machine].id
|
13
13
|
if vm_id
|
14
|
+
|
15
|
+
# VM is in the vagrant registry, now we need to check if it's
|
16
|
+
# actually in vcenter
|
17
|
+
|
18
|
+
# FIXME: this part needs some cleanup
|
19
|
+
config = env[:machine].provider_config
|
20
|
+
|
21
|
+
# FIXME: Raise a correct exception
|
22
|
+
dc = config.vcenter_cnx.serviceInstance.find_datacenter(
|
23
|
+
config.datacenter_name) or abort 'datacenter not found'
|
24
|
+
|
25
|
+
root_vm_folder = dc.vmFolder
|
26
|
+
|
27
|
+
vm = root_vm_folder.findByUuid(env[:machine].id)
|
28
|
+
|
29
|
+
unless vm
|
30
|
+
@logger.info('VM is in the vagrant registry but not in vcenter')
|
31
|
+
# Clear the ID
|
32
|
+
env[:machine].id = nil
|
33
|
+
env[:result] = false
|
34
|
+
end
|
35
|
+
|
36
|
+
# VM is in the registry AND in vcenter
|
14
37
|
@logger.info("VM has been created and ID is: [#{vm_id}]")
|
15
38
|
env[:result] = true
|
39
|
+
|
16
40
|
else
|
41
|
+
# VM is not in the registry
|
17
42
|
@logger.warn('VM has not been created')
|
18
43
|
env[:result] = false
|
19
44
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'socket'
|
2
|
+
|
3
|
+
module VagrantPlugins
|
4
|
+
module VCenter
|
5
|
+
module Action
|
6
|
+
class PrepareNFSSettings
|
7
|
+
include Vagrant::Util::Retryable
|
8
|
+
|
9
|
+
def initialize(app, env)
|
10
|
+
@app = app
|
11
|
+
@logger = Log4r::Logger.new('vagrant_vcenter::action::nfs')
|
12
|
+
end
|
13
|
+
|
14
|
+
def call(env)
|
15
|
+
host_ip = Socket.ip_address_list.find { |ai| ai.ipv4? && !ai.ipv4_loopback? }.ip_address
|
16
|
+
|
17
|
+
@logger.debug("Setting host_ip to #{host_ip}")
|
18
|
+
|
19
|
+
env[:nfs_host_ip] = host_ip
|
20
|
+
@app.call env
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -16,6 +16,11 @@ module VagrantPlugins
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def read_state(env)
|
19
|
+
if env[:machine].id.nil?
|
20
|
+
@logger.info('VM is not created yet')
|
21
|
+
return :not_created
|
22
|
+
end
|
23
|
+
|
19
24
|
# FIXME: this part needs some cleanup
|
20
25
|
config = env[:machine].provider_config
|
21
26
|
|
@@ -27,14 +32,9 @@ module VagrantPlugins
|
|
27
32
|
|
28
33
|
vm = root_vm_folder.findByUuid(env[:machine].id)
|
29
34
|
|
30
|
-
|
35
|
+
# @logger.debug("Current power state: #{vm.runtime.powerState}")
|
31
36
|
vm_name = env[:machine].name
|
32
37
|
|
33
|
-
if env[:machine].id.nil?
|
34
|
-
@logger.info("VM [#{vm_name}] is not created yet")
|
35
|
-
return :not_created
|
36
|
-
end
|
37
|
-
|
38
38
|
if vm.runtime.powerState == 'poweredOff'
|
39
39
|
@logger.info("VM [#{vm_name}] is stopped")
|
40
40
|
return :stopped
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module VCenter
|
3
|
+
module Cap
|
4
|
+
module RDP
|
5
|
+
# Reads the RDP forwarded port that currently exists on the machine
|
6
|
+
# itself. This raises an exception if the machine isn't running.
|
7
|
+
# @return [Hash<Integer, Integer>] Host => Guest port mappings.
|
8
|
+
def self.rdp_info(machine)
|
9
|
+
env = machine.action('read_rdp_info')
|
10
|
+
env[:machine_ssh_info]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module VCenter
|
3
|
+
module Cap
|
4
|
+
module WinRM
|
5
|
+
# Reads the WinRM forwarded port that currently exists on the machine
|
6
|
+
# itself. This raises an exception if the machine isn't running.
|
7
|
+
# @return [Hash<Integer, Integer>] Host => Guest port mappings.
|
8
|
+
def self.winrm_info(machine)
|
9
|
+
env = machine.action('read_winrm_info')
|
10
|
+
env[:machine_ssh_info]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -63,45 +63,6 @@ module VagrantPlugins
|
|
63
63
|
# @return [Bool]
|
64
64
|
attr_accessor :disable_auto_vm_name
|
65
65
|
|
66
|
-
# Use prep and customization api in the building
|
67
|
-
# of the vm in vcenter
|
68
|
-
#
|
69
|
-
# Mostly this allows the static ip configuration
|
70
|
-
# of a vm
|
71
|
-
#
|
72
|
-
# @return [Bool]
|
73
|
-
attr_accessor :enable_vm_customization
|
74
|
-
|
75
|
-
# Type of the machine prep to use
|
76
|
-
#
|
77
|
-
# @return [String]
|
78
|
-
attr_accessor :prep_type
|
79
|
-
|
80
|
-
# Dns server list
|
81
|
-
#
|
82
|
-
# @return [Array<String>]
|
83
|
-
attr_accessor :dns_server_list
|
84
|
-
|
85
|
-
# Dns suffix list
|
86
|
-
#
|
87
|
-
# @return [Array<String>]
|
88
|
-
attr_accessor :dns_suffix_list
|
89
|
-
|
90
|
-
# network gateway
|
91
|
-
#
|
92
|
-
# @return [String]
|
93
|
-
attr_accessor :gateway
|
94
|
-
|
95
|
-
# subnet mask
|
96
|
-
#
|
97
|
-
# @return [String]
|
98
|
-
attr_accessor :netmask
|
99
|
-
|
100
|
-
# ip address
|
101
|
-
#
|
102
|
-
# @return [String]
|
103
|
-
attr_accessor :ipaddress
|
104
|
-
|
105
66
|
# vm network name
|
106
67
|
#
|
107
68
|
# @return [String]
|
@@ -124,8 +85,6 @@ module VagrantPlugins
|
|
124
85
|
# @return [Fixnum]
|
125
86
|
attr_accessor :memory
|
126
87
|
|
127
|
-
|
128
|
-
|
129
88
|
##
|
130
89
|
## vCenter config runtime values
|
131
90
|
##
|
@@ -134,14 +93,6 @@ module VagrantPlugins
|
|
134
93
|
attr_accessor :vcenter_cnx
|
135
94
|
attr_accessor :template_id
|
136
95
|
|
137
|
-
def initialize()
|
138
|
-
@enable_vm_customization = false
|
139
|
-
@prep_type = 'linux'
|
140
|
-
@enable_vm_customization = false
|
141
|
-
@dns_server_list = []
|
142
|
-
@dns_suffix_list = []
|
143
|
-
end
|
144
|
-
|
145
96
|
def validate(machine)
|
146
97
|
errors = _detected_errors
|
147
98
|
|
@@ -161,17 +112,6 @@ module VagrantPlugins
|
|
161
112
|
errors <<
|
162
113
|
I18n.t('vagrant_vcenter.config.network_name') if network_name.nil?
|
163
114
|
|
164
|
-
if enable_vm_customization
|
165
|
-
errors <<
|
166
|
-
I18n.t('vagrant_vcenter.config.no_prep_type') if prep_type != 'linux'
|
167
|
-
errors <<
|
168
|
-
I18n.t('vagrant_vcenter.config.gateway') if gateway.empty?
|
169
|
-
errors <<
|
170
|
-
I18n.t('vagrant_vcenter.config.ipaddress') if ipaddress.empty?
|
171
|
-
errors <<
|
172
|
-
I18n.t('vagrant_vcenter.config.netmask') if netmask.empty?
|
173
|
-
end
|
174
|
-
|
175
115
|
{ 'vCenter Provider' => errors }
|
176
116
|
end
|
177
117
|
end
|
@@ -4,8 +4,8 @@ rescue LoadError
|
|
4
4
|
raise 'The Vagrant vCenter plugin must be run within Vagrant.'
|
5
5
|
end
|
6
6
|
|
7
|
-
if Vagrant::VERSION < '1.
|
8
|
-
fail 'The Vagrant vCenter plugin is only compatible with Vagrant 1.
|
7
|
+
if Vagrant::VERSION < '1.6.0'
|
8
|
+
fail 'The Vagrant vCenter plugin is only compatible with Vagrant 1.6+'
|
9
9
|
end
|
10
10
|
|
11
11
|
module VagrantPlugins
|
@@ -20,7 +20,9 @@ module VagrantPlugins
|
|
20
20
|
Config
|
21
21
|
end
|
22
22
|
|
23
|
-
|
23
|
+
# We provide support for multiple box formats, including the new standard
|
24
|
+
# 'vmware_ovf' and the legacy 'vcloud' and 'vcenter'.
|
25
|
+
provider(:vcenter, box_format: %w[vmware_ovf vcloud vcenter], parallel: true) do
|
24
26
|
setup_logging
|
25
27
|
setup_i18n
|
26
28
|
|
@@ -35,6 +37,16 @@ module VagrantPlugins
|
|
35
37
|
Cap::PublicAddress
|
36
38
|
end
|
37
39
|
|
40
|
+
provider_capability(:vcenter, :winrm_info) do
|
41
|
+
require_relative 'cap/winrm_info'
|
42
|
+
Cap::WinRM
|
43
|
+
end
|
44
|
+
|
45
|
+
provider_capability(:vcenter, :rdp_info) do
|
46
|
+
require_relative 'cap/rdp_info'
|
47
|
+
Cap::RDP
|
48
|
+
end
|
49
|
+
|
38
50
|
def self.setup_i18n
|
39
51
|
I18n.load_path << File.expand_path('locales/en.yml',
|
40
52
|
VCenter.source_root)
|
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.
|
4
|
+
version: 0.3.0
|
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-
|
11
|
+
date: 2014-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: vagrant-rbvmomi
|
@@ -154,11 +154,14 @@ files:
|
|
154
154
|
- lib/vagrant-vcenter/action/message_will_not_destroy.rb
|
155
155
|
- lib/vagrant-vcenter/action/power_off.rb
|
156
156
|
- lib/vagrant-vcenter/action/power_on.rb
|
157
|
+
- lib/vagrant-vcenter/action/prepare_nfs_settings.rb
|
157
158
|
- lib/vagrant-vcenter/action/read_ssh_info.rb
|
158
159
|
- lib/vagrant-vcenter/action/read_state.rb
|
159
160
|
- lib/vagrant-vcenter/action/resume.rb
|
160
161
|
- lib/vagrant-vcenter/action/suspend.rb
|
161
162
|
- lib/vagrant-vcenter/cap/public_address.rb
|
163
|
+
- lib/vagrant-vcenter/cap/rdp_info.rb
|
164
|
+
- lib/vagrant-vcenter/cap/winrm_info.rb
|
162
165
|
- lib/vagrant-vcenter/config.rb
|
163
166
|
- lib/vagrant-vcenter/errors.rb
|
164
167
|
- lib/vagrant-vcenter/plugin.rb
|